{"id":24968,"library":"babel-runtime-es2015-instance-methods","title":"babel-runtime-es2015-instance-methods","description":"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.","status":"deprecated","version":"0.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/makuko/babel-runtime-es2015-instance-methods","tags":["javascript","babel-plugin"],"install":[{"cmd":"npm install babel-runtime-es2015-instance-methods","lang":"bash","label":"npm"},{"cmd":"yarn add babel-runtime-es2015-instance-methods","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-runtime-es2015-instance-methods","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CommonJS require may not work due to ESM export.","wrong":"const plugin = require('babel-runtime-es2015-instance-methods').default","symbol":"default export","correct":"import plugin from 'babel-runtime-es2015-instance-methods'"},{"note":"The plugin does not accept options.","wrong":"{\"plugins\": [\"babel-runtime-es2015-instance-methods\", {\"loose\": true}]}","symbol":"in .babelrc","correct":"{\"plugins\": [\"babel-runtime-es2015-instance-methods\"]}"},{"note":"No subpath exports; use package name directly.","wrong":"const plugin = require('babel-runtime-es2015-instance-methods/default')","symbol":"require usage","correct":"const plugin = require('babel-runtime-es2015-instance-methods')"},{"note":"Never use in presets array.","symbol":"as Babel preset","correct":"// Not designed as a preset; use as plugin only."}],"quickstart":{"code":"// Install: npm install --save-dev babel-runtime-es2015-instance-methods\n// Then in your Babel configuration:\n{\n  \"plugins\": [\"babel-runtime-es2015-instance-methods\"]\n}\n// Or programmatically:\nconst babel = require('@babel/core');\nconst plugin = require('babel-runtime-es2015-instance-methods');\nbabel.transformSync(code, { plugins: [plugin] });\n\n// Input: [1,2,3].includes(2)\n// Output (approximate): var _includes = require(\"babel-runtime-es2015-instance-methods/helpers/includes\");\n// _includes([1,2,3], 2);","lang":"javascript","description":"Shows installation, Babel config, and programmatic usage demonstrating transformation of Array.includes."},"warnings":[{"fix":"Replace with @babel/plugin-transform-runtime and configure core-js: https://babeljs.io/docs/en/babel-plugin-transform-runtime","message":"No longer maintained; use @babel/plugin-transform-runtime with core-js instead.","severity":"deprecated","affected_versions":">=0"},{"fix":"Use a comprehensive polyfill like core-js directly.","message":"Plugin only transforms specific methods; may miss some ES2015 methods (e.g., Array.from, Object.assign).","severity":"gotcha","affected_versions":">=0"},{"fix":"Install babel-runtime alongside (npm install babel-runtime).","message":"Requires external runtime helpers; must ensure babel-runtime is installed (deprecated).","severity":"breaking","affected_versions":">=0"},{"fix":"Use a bundler or switch to @babel/plugin-transform-runtime with useESModules.","message":"Output uses require() for helpers; incompatible with ESM-only environments if helpers not bundled.","severity":"gotcha","affected_versions":">=0"},{"fix":"Migrate to @babel/preset-env with useBuiltIns: 'usage'.","message":"Package name includes 'es2015' which is outdated; Babel now uses 'env' preset.","severity":"deprecated","affected_versions":">=0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install babel-runtime: npm install babel-runtime","cause":"Missing runtime helpers; required separate babel-runtime package.","error":"Error: Cannot find module 'babel-runtime-es2015-instance-methods/helpers/includes'"},{"fix":"Use default import: const plugin = require('babel-runtime-es2015-instance-methods').default or import plugin from '...'","cause":"Using require() incorrectly with ESM default export.","error":"TypeError: plugin is not a function"},{"fix":"Ensure babel-runtime is bundled or use a polyfill like core-js.","cause":"Runtime helpers not loaded; likely missing babel-runtime or using in browser without bundler.","error":"ReferenceError: _includes is not defined"},{"fix":"Use CommonJS require in Node.js or transpile with Babel first.","cause":"Using import syntax without transpilation; only works in ES module context.","error":"SyntaxError: Unexpected token import"},{"fix":"Run npm install babel-runtime-es2015-instance-methods --save-dev","cause":"Package not installed or incorrect import path.","error":"Module not found: Can't resolve 'babel-runtime-es2015-instance-methods'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}