Update the code passed with console logs
npm install @alu0101017396/addloggingA small library providing a method that put a console.log after each function with a description of it.
## Installation
npm install @alu0101017396/addlogging --save
or
npm install --global @alu0101017396/addlogging
## Usage
### How to use the package as a library
Add the followin lines to the head of your program:
`let logging_espree = require('@alu0101017396/addlogging');
let addlogging = logging_espree.addLogging;`
The function addLogging can receive one or two parameters, the first one is a string with the code that will be transform; and the second one is an optional pattern that will filter the function names that are parsed.
An example of use would be:
function foo(a, b) {
let logging_espree = require('@alu0101017396/addlogging');
let addlogging = logging_espree.addLogging;
let declared = addlogging(
var x = 'blah';
var y = function () {
return 3;
}();
}
foo(1, 'wut', 3);); `
console.log("\n\nNormal Function: ")
console.log(declared);
`
With the following output:
Entering foo(${ a }},${ b }}) at line 1
Normal Function:
function foo(a, b) {
console.log();Entering
var x = 'blah';
var y = function () {
console.log();`
return 3;
}();
}
foo(1, 'wut', 3);
### How to execute
This program contains four options:
-V, --version output the version number
-o, --output
-p, --pattern
-h, --help output usage information
to use it put in bash:
$ addlogging
## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style.
Add unit tests for any new or changed functionality. Lint and test your code.
### Tests
If you change any functionality of the package you can add tests to the tests
directory and run them with:
npm test`
## Documentation
https://ull-esit-pl-2021.github.io/espree-logging-module-alu0101017396/
## Release History
* 0.2.4 Initial release
* 0.3.9 Patten addition
* 0.4.14 Executable addition