babel-plugin-minify-guarded-expressions

0.4.3 • Public • Published

babel-plugin-minify-guarded-expressions

Example

In

!&& foo();
alert(0 && new Foo());

Out

|| foo();
alert(0);

Installation

npm install babel-plugin-minify-guarded-expressions --save-dev

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["minify-guarded-expressions"]
}

Via CLI

babel --plugins minify-guarded-expressions script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["minify-guarded-expressions"]
});

Keywords

install

npm i babel-plugin-minify-guarded-expressions

Downloadsweekly downloads

525,119

version

0.4.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability