@ef-carbon/dom

中文文档
15.5.1发布于 2019/04/01MITTypeScriptESM + CJS近 30 天下载 5055

A simple TypeScript document object model

原始使用文档
文档目录10 节
  1. Usage
  2. Development
  3. Getting Started
  4. IDE
  5. Hacking
  6. Testing
  7. Releases
  8. Scripts
  9. Reports
  10. Coverage

EF Document Object Model

CircleCI Code Coverage NPM Version License NPM Weekly Downloads NPM Monthly Downloads NPM Yearly Downloads NPM Total Downloads Node Version Semantic Release Commitizen friendly Conventional Commits

A set of TypeScript interfaces and classes that provide a simple document object model.


WARNING: Project is under heavy development but follows semantic versioning, expect breakage until this warning is removed.


Usage

yarn add @ef-carbon/dom

Read the documentation for API guidance.

Development

The project attempts to make the workflow as frictionless as possible. Any suggestions to improve the work processes are welcomed :metal:

Getting Started

Get up and running using yarn:

yarn install
yarn build

IDE

Install Atom IDE with the TypeScript and XTerm plugins

Hacking

Run yarn watch:test. Unit tests will re-run after any changes to the source code.

Testing

The unit tests use Jest.

Releases

Releases are performed automatically via semantic-release. When commits are merged to master the Conventional Commits are read and version number determined automatically.

Scripts

There are various scripts available that provide the workflow steps for the project:

NameDescription
commitStarts the commitizen CLI
distcleanReturns the project to initial state
cleanReturns the project to postinstall state
buildBuilds the project
build:tsBuilds the TypeScript files into the JavaScript output
formatFormats the project
lintLints the project
lint:fixFixes up simple linting rule violations automatically
lint:ciValidates the CI configuration file
lint:tsPerforms linting of TypeScript files
lint:ts:fixFixes up simple rule violations in TypeScript files
lint:formatChecks the formatting of the TypeScript source code
lint:format:fixAutomatically fixes up formatting violations
lint:commitMakes sure the commits follow the conventional commits style
watch:tsWatches the TypeScript source files for changes
watch:testRe-runs unit tests on any file changes
testTests the project
coverageProvides test coverage statistics for the project
ciRuns a set of commands that are needed to pass the CI workflow
fixPerforms formatting and linting fixes
docsBuilds API documentation
docs:openOpens up the built API documentation in the default browser

Reports

Coverage

Code Coverage Graph

版本与发布记录

@ef-carbon/dom 共发布 58 个版本,首次发布于 2018/01/24;过去 12 个月发布了 0 个版本。

版本发布日期距今
15.5.1latest2019/04/017 年前
15.5.02019/03/297 年前
15.4.12019/03/067 年前
15.4.02019/03/057 年前
15.3.02019/02/117 年前
15.2.12018/12/187 年前

关于 @ef-carbon/dom 的常见问题

@ef-carbon/dom 是什么?

A simple TypeScript document object model

如何安装 @ef-carbon/dom?

在项目目录运行 npm install @ef-carbon/dom,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@ef-carbon/primitive(^4.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@ef-carbon/dom 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@ef-carbon/dom 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@ef-carbon/dom 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=8.3。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@ef-carbon/dom 可以商用吗?

@ef-carbon/dom 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@ef-carbon/dom 的下载量有多少?

根据 npm 官方下载统计,@ef-carbon/dom 在 2026/10/13 – 2026/11/11 这 30 天内被下载 5,055 次,日均约 169 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ef-carbon/dom 还在维护吗?

最新版本 15.5.1 发布于 2019/04/01(7 年前);至今共发布 58 个版本,其中过去 12 个月发布了 0 个;首次发布于 2018/01/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。