@gerhobbelt/babel-preset-power-assert
v3.0.0-1
Published
Babel preset for all power-assert plugins
Downloads
12
Maintainers
Readme
babel-preset-power-assert
is a Babel preset for all power-assert plugins.
babel-preset-power-assert
contains plugins below
- babel-plugin-empower-assert: Babel plugin to convert assert to power-assert at compile time
- babel-plugin-espower: Babel plugin for power-assert
INSTALL
$ npm install --save-dev babel-preset-power-assert power-assert
CAUTION
Babel7 is incompatible with Babel6.
For Babel6, you need to use the 2.x release of babel-preset-power-assert.
$ npm install --save-dev [email protected]
HOW TO USE
via .babelrc (Recommended)
{
"presets": [
"power-assert"
]
}
via Babel CLI
$ babel --presets power-assert /path/to/src/target.js > /path/to/build/target.js
via Babel API
var babel = require('@babel/core');
var jsCode = fs.readFileSync('/path/to/src/target.js');
var transformed = babel.transform(jsCode, {
presets: ['power-assert']
});
console.log(transformed.code);
AUTHOR
LICENSE
Licensed under the MIT license.