1.0.0 • Published 4 years ago

@alu0101138558/addlogging v1.0.0

Weekly downloads
69
License
ISC
Repository
github
Last release
4 years ago

AddLogging =========

A small library providing utility methods to add Logging after detect a function.

Installation

  npm install @alu0101138558/addLogging --save

Usage

  const { addLogging } = require('@alu0101138558/addLogging')

  let input = `function foo(a, b) {
            var x = 'blah';
            var y = (function (z) {
              return z+3;
            })(2);
          }      
          foo(1, 'wut', 3);`
  let output = addLogging(input)
  console.log(output);

  // RESULT: 
  /* 
  function foo(a, b) {
    console.log(\`Entering foo(${ a },${ b }) at line 1\`);\n
    var x = 'blah'; 
    var y = function (z) { 
      console.log(\`Entering <anonymous function>(${ z }) at line 3\`);
        return z + 3;
    }(2);
  }
  foo(1, 'wut', 3);
  */

Tests

  npm test

API Documents

To generate the docs I use documentation.js:

 npm run doc

Install $ npm install -g documentation

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.

Release History

  • 0.1.0 Initial release
  • 0.1.5 Semi finish version