https://github.com/hzoo/babel-plugin-minify-booleans
Turn boolean literals into !0 for true and !1 for false.
https://github.com/hzoo/babel-plugin-minify-booleans
Last synced: 2 months ago
JSON representation
Turn boolean literals into !0 for true and !1 for false.
- Host: GitHub
- URL: https://github.com/hzoo/babel-plugin-minify-booleans
- Owner: hzoo
- Created: 2015-08-31T22:21:14.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-24T13:24:28.000Z (almost 10 years ago)
- Last Synced: 2025-01-14T16:56:40.596Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 113 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# babel-plugin-minify-booleans
Turn boolean literals into !0 for true and !1 for false.
## Installation
```sh
$ npm install babel-plugin-minify-booleans
```## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```json
{
"plugins": ["minify-booleans"]
}
```### Via CLI
```sh
$ babel --plugins minify-booleans script.js
```### Via Node API
```javascript
require("babel-core").transform("code", {
plugins: ["minify-booleans"]
});
```