
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
@mdn/browser-compat-data
Advanced tools
@mdn/browser-compat-datahttps://github.com/mdn/browser-compat-data
The browser-compat-data ("BCD") project contains machine-readable browser (and JavaScript runtime) compatibility data for Web technologies, such as Web APIs, JavaScript features, CSS properties and more. Our goal is to document accurate compatibility data for Web technologies, so web developers may write cross-browser compatible websites easier. BCD is used in web apps and software such as MDN Web Docs, CanIUse, Visual Studio Code, WebStorm and more.
Read how this project is governed.
Chat with us on Matrix at chat.mozilla.org#mdn!
Are you interested in contributing to this project? Check out the Contributing to browser-compat-data documentation.
[!TIP] Looking for something? Consult the alphabetical index of the project documentation.
You can install @mdn/browser-compat-data as a node package.
npm install @mdn/browser-compat-data
# ...or...
yarn add @mdn/browser-compat-data
Then, you can import BCD into your project with either import or require():
// ESM with Import Attributes (NodeJS 20+)
import bcd from '@mdn/browser-compat-data' with { type: 'json' };
// ...or...
const { default: bcd } = await import('@mdn/browser-compat-data', {
with: { type: 'json' },
});
// ...or...
// ESM with Import Assertions (NodeJS 16+)
import bcd from '@mdn/browser-compat-data' assert { type: 'json' };
// ...or...
const { default: bcd } = await import('@mdn/browser-compat-data', {
assert: { type: 'json' },
});
// ...or...
// ESM Wrapper for older NodeJS versions (NodeJS v12+)
import bcd from '@mdn/browser-compat-data/forLegacyNode';
// ...or...
const { default: bcd } = await import('@mdn/browser-compat-data/forLegacyNode');
// ...or...
// CommonJS Module (Any NodeJS)
const bcd = require('@mdn/browser-compat-data');
You can import @mdn/browser-compat-data using a CDN.
// ESM with Import Attributes (Deno 1.37+)
import bcd from 'https://unpkg.com/@mdn/browser-compat-data' with { type: 'json' };
// ...or...
const { default: bcd } = await import(
'https://unpkg.com/@mdn/browser-compat-data',
{
with: { type: 'json' },
}
);
// ...or...
// ESM with Import Assertions (Deno 1.17+)
import bcd from 'https://unpkg.com/@mdn/browser-compat-data' assert { type: 'json' };
// ...or...
const { default: bcd } = await import(
'https://unpkg.com/@mdn/browser-compat-data',
{
assert: { type: 'json' },
}
);
// ...or...
// Fetch Method (Deno 1.0+)
const bcd = await fetch('https://unpkg.com/@mdn/browser-compat-data').then(
(response) => response.json(),
);
You can obtain the raw compatibility data for @mdn/browser-compat-data using a CDN and loading the data.json file included in releases.
https://unpkg.com/@mdn/browser-compat-data/data.json
Once you have imported BCD, you can access the compatibility data for any feature by accessing the properties of the dictionary.
// Grab the desired support statement
const support = bcd.css.properties.background.__compat;
// returns a compat data object (see schema)
// You may use any syntax to obtain dictionary items
const support = bcd['api']['Document']['body']['__compat'];
BCD exports TypeScript type definitions. Type definitions are automatically generated from the schema definitions.
The @mdn/browser-compat-data package contains a tree of objects, with support and browser data objects at their leaves. There are over 15,000 features in the dataset; this documentation highlights significant portions, but many others exist at various levels of the tree.
The definitive description of the format used to represent individual features and browsers is the schema definitions.
Apart from the explicitly documented objects below, feature-level support data may change at any time. See Semantic versioning policy for details.
The package contains the following top-level objects:
__metaAn object containing the following package metadata:
version - the package versiontimestamp - the timestamp of when the package version was builtapiData for Web API features.
browsersData for browsers and JavaScript runtimes. See the browser schema for details.
cssData for CSS features, including:
at-rules - at-rules (e.g. @media)properties - Properties (e.g. background, color, font-variant)selectors - Selectors (such as basic selectors, combinators, or pseudo elements)types - Value types for rule valueshtmlData for HTML features, including:
elements - Elementsglobal_attributes - Global attributeshttpData for HTTP features, including:
headers - Request and response headersmethods - Request methodsstatus - Status codesjavascriptData for JavaScript language features, including:
builtins - Built-in objectsclasses - Class definition featuresfunctions - Function featuresgrammar - Language grammaroperators - Mathematical and logical operatorsstatements - Language statements and expressionsmanifestswebapp - Web App manifest keysmathmlData for MathML features, including:
elements - ElementssvgData for SVG features, including:
attributes - Attributeselements - ElementswebassemblyData for WebAssembly features.
webdriverData for WebDriver features, including:
bidi - WebDriver BiDi protocolclassic - WebDriver Classic protocolwebextensionsData for WebExtensions features, including:
api - WebExtension-specific APIsmanifest - manifest.json keysFor the purposes of semantic versioning (SemVer), the public API consists of:
The details of browser compatibility change frequently, as browsers ship new features, standards organizations revise specifications, and Web developers discover new bugs. We routinely publish updates to the package to reflect these changes.
You should expect lower-level namespaces, feature data, and browser data to be added, removed, or modified at any time. That said, we strive to communicate changes and preserve backward compatibility; if you rely on a currently undocumented portion of the package and want SemVer to apply to it, please open an issue.
Now that you know what this project is, let's mention what this project isn't. This project is not:
If you find a problem with the compatibility data (such as incorrect version numbers) or there is a new web feature you think we should document, please file a bug.
Thank you for your interest in contributing to this project! See Contributing to browser-compat-data for more information.
Here are some projects using the data, as an npm module or directly:
webhint.io - Tool that uses BCD to checks CSS and HTML for unsupported features (see @hint/utils-compat-data package).Thanks to:
The BrowserStack Open Source Program for testing services |
Sauce Labs Open Source for testing services |
LambdaTest Open Source for testing services |
caniuse-lite is a smaller, more compact version of the data from caniuse.com. It provides browser support tables for various web technologies. Compared to @mdn/browser-compat-data, caniuse-lite is more lightweight and focuses on providing quick access to compatibility data.
browserslist is a tool that allows you to specify which browsers you want to support in your project. It uses data from caniuse-lite to determine browser compatibility. While @mdn/browser-compat-data provides detailed compatibility information, browserslist helps you configure your project to support specific browsers.
FAQs
Browser compatibility data provided by MDN Web Docs
The npm package @mdn/browser-compat-data receives a total of 847,053 weekly downloads. As such, @mdn/browser-compat-data popularity was classified as popular.
We found that @mdn/browser-compat-data demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

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.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.