babel-plugin-console-prepend

0.0.1 • Public • Published

babel-plugin-console-prepend

build status

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'],
});

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i babel-plugin-console-prepend

    Weekly Downloads

    0

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • jephuff