babel-plugin-console-prepend
v0.0.1
Published
A simple transform that prepends uncommited console.log calls with a string
Downloads
2
Readme
babel-plugin-console-prepend
A simple transform that prepends uncommited console.log calls with a string
Install
$ npm i --save-dev babel-plugin-console-prepend babel-cli
Example
Transforms
console.log(val); // this line has been committed
console.log(val); // this line has not been committed
to
console.log(val); // this line has been committed
console.log('prefix', val); // this line has not been committed
Usage
.babelrc
{
"plugins": ["console-prepend"],
}
Set plugin options using an array of [pluginName, optionsObject]
.
{
"plugins": [["console-prepend", { "prefix": "I wrote this" }]],
}
Babel CLI
$ babel --plugins console-prepend script.js
Babel API
require('babel-core').transform('code', {
'plugins': ['console-prepend'],
});