Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-replace-expressions

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-replace-expressions

Replace JavaScript expressions with other expressions.

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
34K
decreased by-54.5%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-transform-replace-expressions

Replace JavaScript expressions with other expressions.

Installation

$ yarn add --dev babel-plugin-transform-replace-expressions

Example

Input file:

const env = process.env.NODE_ENV;

typeof Hello === "number";

.babelrc:

{
  "plugins": [
    [
      "babel-plugin-transform-replace-expressions",
      {
        "process.env.NODE_ENV": "\"production\"",
        "typeof Hello": "42"
      }
    ]
  ]
}

Output:

const env = "production";

42 === "number";

License

This plugin is licensed under the MIT license. See LICENSE.

FAQs

Package last updated on 24 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc