@alu0101211770/addlogging
v1.1.0
Published
--- > ###### Alejandro Peraza González > ###### University of La Laguna ---
Readme
AddLogging
Alejandro Peraza González
University of La Laguna
Package that provides the method addLogging, using espree to create an AST to be analayzed using estraverse.
The purpose of this method is to receive an inpu code in js to add a console.log entering each function with the information of it.
Installation
npm install @alu0101211770/addLogging --save
Usage
To execute the script
npx add-logging --pattern 'functionNamePattern' --output salida.js input.js
To use the module itself
logging = require("@alu0101211770/addlogging");
let input = `function foo(a,b) {}`
console.log
// Expected output:
/*
function foo(a, b) {
console.log('Entering foo(${ a },${ b }) at line 1');
}
*/Tests
npm test
API Documentation
The package documentation was used to generate a web documentation. To run it, I used the script doc in the next way:
npm run docContributing
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.
Release History
- 0.1.0 Initial release
- 0.1.1 Minor Fixes
- 0.1.2 Minor Fixes
- 0.2.0 Added Regex for the pattern
- 0.2.1 Bug fix in dependencies
- 0.3.0 Now able to execute add-logging using multiple input files
- 1.0.0 Now able to execute add-logging using a directory
- 1.0.1 Minor fix
- 1.1.0 Brought back executing without a directory
