mdn-data

中文文档
2.37.2发布于 2026/10/03CC0-1.0CommonJS零依赖构建来源已验证近 30 天下载 5.4亿

Open Web data by the Mozilla Developer Network

原始使用文档
文档目录7 节
  1. Repository contents
  2. api
  3. css
  4. l10n
  5. Problems?
  6. Contributing
  7. See also

Welcome to MDN data

Note We are in the process of deprecating the mdn/data package in favor of w3c/webref. If you depend on this project, let us know in our community GitHub discussions. Thank you.

NPM version lint

This repository contains general data for Web technologies and is maintained by the MDN team at Mozilla.

Repository contents

The data in this repository is used in MDN Web Docs to build information boxes and sidebar navigation. External tools make use of this data as well, for example, the CSSTree CSS parser.

There's a top-level directory for each broad area covered: for example, api and css. Inside each of these directories is one or more JSON files containing the data.

api

Contains data about Web APIs:

  • API inheritance (interface inheritance and mixin implementations)

css

Contains data about:

  • CSS at-rules
  • CSS functions
  • CSS properties
  • CSS selectors
  • CSS syntaxes
  • CSS types
  • CSS units

For more information, see the CSS data documentation and the Updating CSS JSON DB guide.

l10n

The l10n folder contains localization strings that are used in the various json files throughout this repository.

Problems?

If you find a problem, please file an issue.

Contributing

We're very happy to accept contributions to this data. Please familiarize yourself with the schema for the data you're editing, and send us a pull request. See the CONTRIBUTING.md document for more information.

See also

版本与发布记录

mdn-data 共发布 95 个版本,首次发布于 2017/06/22;过去 12 个月发布了 16 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.37.2latest2026/10/031 个月前
2.37.12026/09/291 个月前
2.37.02026/09/231 个月前
2.36.02026/09/151 个月前
2.35.02026/09/022 个月前
2.34.02026/08/292 个月前

关于 mdn-data 的常见问题

mdn-data 是什么?

Open Web data by the Mozilla Developer Network

如何安装 mdn-data?

在项目目录运行 npm install mdn-data,或使用 pnpm add / yarn add / bun add。

mdn-data 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/mdn-data 是否存在。

mdn-data 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

mdn-data 可以商用吗?

mdn-data 使用 CC0-1.0 许可。作者放弃著作权,可不受限制地使用。以上为概括,不构成法律意见,请以许可原文为准。

mdn-data 的下载量有多少?

根据 npm 官方下载统计,mdn-data 在 2026/10/05 – 2026/11/03 这 30 天内被下载 539,093,089 次,日均约 17,969,770 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

mdn-data 还在维护吗?

最新版本 2.37.2 发布于 2026/10/03(1 个月前);至今共发布 95 个版本,其中过去 12 个月发布了 16 个;首次发布于 2017/06/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。