Registry / serialization / babel-preset-es2015-nostrict

babel-preset-es2015-nostrict

JSON →
library6.6.2jsnpmunverified

A Babel preset that includes all ES2015 plugins but suppresses the automatic insertion of 'use strict' at the top of compiled modules. This is useful for projects that need to avoid strict mode globally (e.g., when concatenating scripts or using non-strict dependencies). The preset mirrors babel-preset-es2015 (v6.6.2) but without the strict-mode directive. It was released in 2015-2016 as part of the Babel 6 ecosystem. This package is now obsolete; Babel 7+ deprecates presets like this in favor of @babel/preset-env with the 'modules' and 'config' options. Key differentiator: removes strict-mode enforcement for legacy code compatibility.

npm install babel-preset-es2015-nostrict
INSTALL
IMPORT
SIG · BABEL-PRESET-ES201
B
babel-preset-es2015-nostrict
serializationjavascriptv6.6.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

preset
// In .babelrc: { "presets": ["es2015-nostrict"] }
// Wrong: require('babel-preset-es2015-nostrict') directly without using the preset string
This preset is not imported as a JavaScript module; it is referenced by name in Babel configuration.
babel-preset-es2015-nostrict
require('babel-preset-es2015-nostrict')
var preset = require('babel-preset-es2015-nostrict').default;
Avoid using .default; the module exports the preset function directly.
babel-core (transform API)
require('babel-core').transform(code, { presets: ['es2015-nostrict'] })
require('babel-core').transform(code, { presets: [require('babel-preset-es2015-nostrict')] })
Refer to the preset by string name, not by requiring it directly in the presets array.

Shows installation, configuration via .babelrc, and demonstrates that strict mode is omitted in output.

// 1. Install: // npm install --save-dev babel-preset-es2015-nostrict babel-cli // 2. .babelrc { "presets": ["es2015-nostrict"] } // 3. Run: // babel script.js --out-file compiled.js // Example input (ES2015): const greet = name => `Hello, ${name}!`; // Output (no 'use strict'): var greet = function greet(name) { return 'Hello, ' + name + '!'; };
Debug
Known issues
deprecatedbabel-preset-es2015-nostrict is deprecated in favor of using @babel/preset-env with the 'modules' option and appropriate config.
fix
Migrate to Babel 7+ and use @babel/preset-env. To disable strict mode, set 'modules' to 'false' or use 'loose' transforms.
affects: >=6.0.0
breakingThe preset does not include any polyfills; it only transforms syntax. You may need babel-polyfill for runtime features like Promise or Symbol.
fix
Add babel-polyfill as a separate import or use @babel/preset-env with useBuiltIns.
affects: all
gotchaWithout 'use strict', code may run in sloppy mode, which can expose differences in behavior (e.g., with this binding, reserved words).
fix
If you need strict mode in some files, consider splitting your build process or using the standard babel-preset-es2015.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'babel-preset-es2015-nostrict'
The preset is not installed as a devDependency.
fix
Run 'npm install --save-dev babel-preset-es2015-nostrict'
SyntaxError: Unexpected token import
Babel is not configured to transform ES2015 modules, or the preset is not applied correctly.
fix
Ensure .babelrc contains { "presets": ["es2015-nostrict"] } and that babel-cli or babel-register is used.
Upgrade
Version history
6.6.2latest on npm
Audit
Dependencies
babel-preset-es2015requiredThis preset modifies the standard es2015 preset by removing the 'use strict' insertion.
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
babel-preset-es2015-nostrict — npm install babel-preset-es2015-nostrict · libregistry