PL ULL 2021 - Espree Logging
npm install @alu0101244587/addloggingbash
npm install @alu0101244587/addloggingnpm i @alu0101244587/addlogging
`$3
`bash
npm install -g @alu0101244587/addloggingnpm i -g @alu0101244587/addlogging
`$3
When we install on local, to test our module, we need to use, for example, to open the help usage:
`bash
npx addlogging -h
`But if we install as global, we could do this:
`bash
addlogging -h
`---
Command line options
`js
'-V' [version]
'-h, --help' [help]
'-o, --output' ' [specify an output file]
'-p, --pattern ' [specify the name of a function]
`
go back up---
Usage Examples
#### Once we had install this module, we could try first this module using the option -h to recive some help:
`bash
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).
`bash
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:
`js
console.log( 'Hello, World!');const first = () => {
alert('hi!')
}
function foo( hello ) {
return hello + 'word';
}
``bash
$ addlogging test/hello-world.js
`#### All right, let's try sending the output to an output file:
`js
console.log('Hello, World!');
const first = () => {
console.log(Entering );
alert('hi!');
};
function foo(hello) {
console.log(Entering foo(${ hello }) at line 7);
return hello + 'world';
}
``bash
$ 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.
`js
console.log('Hello, World!');
const first = () => {
alert('hi!');
};
function foo(hello) {
console.log(Entering foo(${ hello }) at line 7);
return hello + 'world';
}
``bash
$ addlogging test/hello-world.js -p foo
`#### Let's see pattern and output working at the same:
`js
console.log('Hello, World!');
const first = () => {
alert('hi!');
};
function foo(hello) {
console.log(Entering foo(${ hello }) at line 7);
return hello + 'world';
}
``bash
$ addlogging test/hello-world.js -p foo -o test/output.js
``To keep an module organization, try to keep testing files on /test.
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