Socket
Socket
Sign inDemoInstall

babel-plugin-transform-strict-mode

Package Overview
Dependencies
Maintainers
4
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-strict-mode

This plugin places a 'use strict'; directive at the top of all files to enable strict mode


Version published
Weekly downloads
1.7M
increased by4.62%
Maintainers
4
Weekly downloads
 
Created
Source

babel-plugin-transform-strict-mode

This plugin places a "use strict"; directive at the top of all files to enable strict mode.

This plugin may be enabled via babel-plugin-transform-es2015-modules-commonjs. If you wish to disable it you can either turn strict off or pass strictMode: false as an option to the commonjs transform.

Example

In

foo();

Out

"use strict";

foo();

Installation

npm install --save-dev babel-plugin-transform-strict-mode

Usage

.babelrc

Without options:

{
  "plugins": ["transform-strict-mode"]
}

With options:

{
  "plugins": [
    ["transform-strict-mode", {
      "strict": true
    }]
  ]
}

Via CLI

babel --plugins transform-strict-mode script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-strict-mode"]
});

Keywords

FAQs

Package last updated on 12 Jul 2017

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