addLogging
Index
Installation
Local instalation
npm install @alu0101244587/addlogging
npm i @alu0101244587/addlogging
Global instalation
npm install -g @alu0101244587/addlogging
npm i -g @alu0101244587/addlogging
To consider
When we install on local, to test our module, we need to use, for example, to open the help usage:
npx addlogging -h
But if we install as global, we could do this:
addlogging -h
Command line options
'-V' [version]
'-h, --help' [help]
'-o, --output' <filename>' [specify an output file]
'-p, --pattern <function>' [specify the name of a function]
Usage Examples
Once we had install this module, we could try first this module using the option -h to recive some help:
npx addlogging -h
Also it is a good idea see if the version that we have download is who is working on our computer (-V option).
npx addlogging -V
Now, we are going to try to seems if our program is working correctly with files, for that, we call our module with .js:
console.log( 'Hello, World!');
const first = () => {
alert('hi!')
}
function foo( hello ) {
return hello + 'word';
}
$ addlogging test/hello-world.js
All right, let's try sending the output to an output file:
console.log('Hello, World!');
const first = () => {
console.log(`Entering <anonymous function>() at line 3`);
alert('hi!');
};
function foo(hello) {
console.log(`Entering foo(${ hello }) at line 7`);
return hello + 'world';
}
$ addlogging test/hello-world.js -o test/output.js
With pattern we tell him wich function to analize as follows:
Previously we know that on hello-world.js exist a function called 'foo'. If it does not exist, our module return the original code.
console.log('Hello, World!');
const first = () => {
alert('hi!');
};
function foo(hello) {
console.log(`Entering foo(${ hello }) at line 7`);
return hello + 'world';
}
$ addlogging test/hello-world.js -p foo
Let's see pattern and output working at the same:
console.log('Hello, World!');
const first = () => {
alert('hi!');
};
function foo(hello) {
console.log(`Entering foo(${ hello }) at line 7`);
return hello + 'world';
}
$ addlogging test/hello-world.js -p foo -o test/output.js
To keep an module organization, try to keep testing files on /test.
Release History
- 0.1.1 initial version
- 0.1.2 some structure changes who does not affect to module funcionality
- 0.1.3 superficial changes
- 0.1.4 correcting some issues
- 0.2.0 first big modification, changing some important functionalities and adding new ones
- 0.2.1 pre-latest version, working as 0.2.0 but changing some bugs on module dependencies
- 1.0.0 first complete usable version
- 1.0.1 changes on the module explain
- 1.0.2 latest: changes on usage examples
@luisleonjeremy
Search for MIT licence on node_modules/@alu0101244587/addlogging