function-logger
v0.0.5
Published
Logging of the input and output arguments of the function on each call
Downloads
24
Maintainers
Readme
function-logger
Logging of the input and output arguments of the function on each call.
Example
code
function doJob(job) {
console.log('I did the job: ' + job);
return 'job report: ' + job;
}
// doJob('run')
functionLogger(doJob)('run');
output in console
Install
npm install function-logger --save-dev
You can set globally, to be used in all their projects without having to install each.
Usage
Wrap the function for which you want to watch. And yet! :checkered_flag:
import functionLogger from 'function-logger';
// foo('bar')
functionLogger(foo)('bar')
Usage for CodePen and JSBin as UMD module
in html area
<script src="https://unpkg.com/function-logger@latest/build/umd/index.js"></script>
in js area use functionLogger
from global scope
Contributing
Got ideas on how to make this better? Open an issue!
License
MIT