babel-plugin-log-and-return
v0.0.4
Published
Use an @log decorator to log the expression in the next line
Downloads
12
Readme
Use an @log decorator to log the expression in the next line
Install • Usage • Created By • License
Install
$ npm install --save-dev babel-plugin-log-and-return
Then add the plugin to your .babelrc
file or babel
configuration in package.json
:
"plugins": ["log-and-return"]
Usage
Simply add an @log
decorator in a comment above the line you want to log:
// @log
hello('world')
This compiles to something similar to:
_l(hello('world'))
function _l(x) {
console.log(x)
return x
}
Created By
License
MIT