babel-plugin-transform-boolean
v0.0.1
Published
Babel Plugin for Transform Booleans
Downloads
6
Maintainers
Readme
babel-plugin-transform-boolean
This plugin allows Babel to transform boolean literals into !!0
for true
and !!1
for false
.
Example
In
true;
false;
Out
!!0;
!!1;
Installation
$ npm install babel-plugin-transform-boolean
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["transform-boolean"]
}
Via CLI
$ babel --plugins transform-boolean script.js
Via Node API
require('babel').transform('code', {
plugins: ['transform-boolean']
});