{"id":18672,"library":"polyfills-db","title":"polyfills-db","description":"A database of browser polyfill features, version 3.0.0, released as needed. Provides structured metadata about which browsers support each feature and which modules/files implement it. Supports runtime JS polyfills, recast-based JS transpilation, and postcss-based CSS transpilation. Key differentiator: centralized polyfill data for multiple transpilation targets, manually maintained with community contributions. Release cadence: irregular, stable.","status":"active","version":"3.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/polyfills/db","tags":["javascript","database","db","polyfills","features","detects"],"install":[{"cmd":"npm install polyfills-db","lang":"bash","label":"npm"},{"cmd":"yarn add polyfills-db","lang":"bash","label":"yarn"},{"cmd":"pnpm add polyfills-db","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default import is supported. ESM-only since v3. CJS require() will not work.","wrong":"const polyfillsDB = require('polyfills-db')","symbol":"polyfills-db","correct":"import polyfillsDB from 'polyfills-db'"},{"note":"Named export for the raw database object. ESM-only.","wrong":"const { data } = require('polyfills-db')","symbol":"data","correct":"import { data } from 'polyfills-db'"},{"note":"Named export, not default. List of feature keys.","wrong":"import features from 'polyfills-db'","symbol":"features","correct":"import { features } from 'polyfills-db'"},{"note":"Named export for browser support matrix.","symbol":"browsers","correct":"import { browsers } from 'polyfills-db'"}],"quickstart":{"code":"import polyfillsDB, { data, features, browsers } from 'polyfills-db';\n// Log all feature keys\nconsole.log(features);\n// Check browser support for a feature\nconst feature = 'es6-array-from';\nif (data[feature]) {\n  console.log(`Browsers supporting ${feature}:`, data[feature].browsers);\n}\n// List available browsers\nconsole.log('Browsers:', browsers);\n// The database is a plain object; iterate features\nfor (const feat of features) {\n  console.log(feat, data[feat].polyfills);\n}","lang":"typescript","description":"Shows basic usage: import database, list features, and check browser support."},"warnings":[{"fix":"Use import syntax or dynamic import().","message":"polyfills-db v3 is ESM-only; require() throws ERR_REQUIRE_ESM.","severity":"breaking","affected_versions":">=3.0"},{"fix":"Update to access data[feature].browsers and data[feature].polyfills.","message":"The data format changed in v3: previously flat arrays now nested objects.","severity":"deprecated","affected_versions":">=3.0"},{"fix":"When using regenerator, omit es7-async-fn from polyfill list.","message":"The 'regenerator' feature includes 'es7-async-fn'; do not use both or runtime duplication occurs.","severity":"gotcha","affected_versions":"*"},{"fix":"Cross-check with caniuse.com or MDN for latest data.","message":"Manually maintained; browser support data may be outdated for recent browser versions.","severity":"gotcha","affected_versions":"*"},{"fix":"Node.js v12+ supports ESM; add 'type':'module' to package.json.","message":"Version 2.x used CJS; v3 drops CJS support entirely.","severity":"deprecated","affected_versions":">=3.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Switch to import: import polyfillsDB from 'polyfills-db'","cause":"Using require() with v3 ESM package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/polyfills-db not supported."},{"fix":"Check the feature exists in the features array before accessing data[feature].browsers.","cause":"Accessing data[feature] where feature key does not exist in the database.","error":"TypeError: Cannot read property 'browsers' of undefined"},{"fix":"Update Node.js to >=12 and add 'type':'module' to your package.json.","cause":"Node.js version <12 without ESM support, or missing 'type':'module' in package.json.","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}