babel-plugin-minify-guarded-expressions

    0.4.4 • 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

    1,245,536

    Version

    0.4.4

    License

    MIT

    Unpacked Size

    5.02 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar