Registry / babel-runtime-es2015-instance-methods

babel-runtime-es2015-instance-methods

JSON →
library0.1.2jsnpmunverified

A Babel plugin that transforms calls to ES2015 instance methods on Array and String to helper runtime polyfills, ensuring compatibility in older environments. Version 0.1.2, no longer actively maintained. It targets specific methods (copyWithin, entries, fill, find, findIndex, keys, values for Array; codePointAt, endsWith, includes, repeat, startsWith for String) but lacks broader support and has been superseded by @babel/plugin-transform-runtime or core-js-based polyfills. No release cadence documented; last update likely years ago.

npm install babel-runtime-es2015-instance-methods
INSTALL
IMPORT
SIG · BABEL-RUNTIME-ES20
B
babel-runtime-es2015-instance-methods
javascriptv0.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

default export
import plugin from 'babel-runtime-es2015-instance-methods'
const plugin = require('babel-runtime-es2015-instance-methods').default
CommonJS require may not work due to ESM export.
in .babelrc
{"plugins": ["babel-runtime-es2015-instance-methods"]}
{"plugins": ["babel-runtime-es2015-instance-methods", {"loose": true}]}
The plugin does not accept options.
require usage
const plugin = require('babel-runtime-es2015-instance-methods')
const plugin = require('babel-runtime-es2015-instance-methods/default')
No subpath exports; use package name directly.
as Babel preset
// Not designed as a preset; use as plugin only.
Never use in presets array.

Shows installation, Babel config, and programmatic usage demonstrating transformation of Array.includes.

// Install: npm install --save-dev babel-runtime-es2015-instance-methods // Then in your Babel configuration: { "plugins": ["babel-runtime-es2015-instance-methods"] } // Or programmatically: const babel = require('@babel/core'); const plugin = require('babel-runtime-es2015-instance-methods'); babel.transformSync(code, { plugins: [plugin] }); // Input: [1,2,3].includes(2) // Output (approximate): var _includes = require("babel-runtime-es2015-instance-methods/helpers/includes"); // _includes([1,2,3], 2);
Debug
Known issues
deprecatedNo longer maintained; use @babel/plugin-transform-runtime with core-js instead.
fix
Replace with @babel/plugin-transform-runtime and configure core-js: https://babeljs.io/docs/en/babel-plugin-transform-runtime
affects: >=0
gotchaPlugin only transforms specific methods; may miss some ES2015 methods (e.g., Array.from, Object.assign).
fix
Use a comprehensive polyfill like core-js directly.
affects: >=0
breakingRequires external runtime helpers; must ensure babel-runtime is installed (deprecated).
fix
Install babel-runtime alongside (npm install babel-runtime).
affects: >=0
gotchaOutput uses require() for helpers; incompatible with ESM-only environments if helpers not bundled.
fix
Use a bundler or switch to @babel/plugin-transform-runtime with useESModules.
affects: >=0
deprecatedPackage name includes 'es2015' which is outdated; Babel now uses 'env' preset.
fix
Migrate to @babel/preset-env with useBuiltIns: 'usage'.
affects: >=0
Errors
Common errors & fixes
Error: Cannot find module 'babel-runtime-es2015-instance-methods/helpers/includes'
Missing runtime helpers; required separate babel-runtime package.
fix
Install babel-runtime: npm install babel-runtime
TypeError: plugin is not a function
Using require() incorrectly with ESM default export.
fix
Use default import: const plugin = require('babel-runtime-es2015-instance-methods').default or import plugin from '...'
ReferenceError: _includes is not defined
Runtime helpers not loaded; likely missing babel-runtime or using in browser without bundler.
fix
Ensure babel-runtime is bundled or use a polyfill like core-js.
SyntaxError: Unexpected token import
Using import syntax without transpilation; only works in ES module context.
fix
Use CommonJS require in Node.js or transpile with Babel first.
Module not found: Can't resolve 'babel-runtime-es2015-instance-methods'
Package not installed or incorrect import path.
fix
Run npm install babel-runtime-es2015-instance-methods --save-dev
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
babel-runtime-es2015-instance-methods — npm install babel-runtime-es2015-instance-methods · libregistry