0.0.1 • Published 8 years ago

babel-plugin-transform-boolean v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

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