@ef-carbon/primitive

中文文档
4.9.5发布于 2018/07/17MITTypeScriptESM + CJS零依赖近 30 天下载 5105

Provides TypeScript interfaces and JavaScript classes for representing primitive values

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

EF Primitive Library

CircleCI Code Coverage Greenkeeper NPM Version License NPM Weekly Downloads NPM Monthly Downloads NPM Yearly Downloads NPM Total Downloads Node Version Semantic Release Commitizen friendly Conventional Commits Direct Dependencies Status Developer Dependencies Status Peer Dependencies Status Optional Dependencies Status

Provides TypeScript interfaces and JavaScript classes for representing primitive values

Usage

yarn add @ef-carbon/primitive

Read the documentation for API guidance. View the presentation for a quick overview of the project.

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
build:rollupRollups the ECMAscript modules in CommonJS modules
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/primitive 共发布 32 个版本,首次发布于 2018/03/02;过去 12 个月发布了 0 个版本。

版本发布日期距今
4.9.5latest2018/07/178 年前
4.9.42018/07/178 年前
4.9.32018/07/168 年前
4.9.22018/07/108 年前
4.9.12018/07/108 年前
4.9.02018/07/048 年前

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

@ef-carbon/primitive 是什么?

Provides TypeScript interfaces and JavaScript classes for representing primitive values

如何安装 @ef-carbon/primitive?

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

@ef-carbon/primitive 支持 TypeScript 吗?

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

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

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

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

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

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

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

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

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

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

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