@digitalcredentials/dcc-context

中文文档
1.0.0发布于 2022/01/20MITESM + CJS零依赖近 30 天下载 4759

DCC core JSON-LD context.

原始使用文档
文档目录7 节
  1. Table of Contents
  2. Background
  3. Install
  4. Usage
  5. API
  6. Developing
  7. License

DCC Context and Schema Repo (@digitalcredentials/dcc-context)

Build status

DCC core artifacts: contexts and schemas.

Table of Contents

Background

An NPM module and JSON-LD source file for the DCC context:

https://w3id.org/dcc/v1

See also (related specs):

Install

Requires Node.js 12+

To install via NPM, add the following to your package.json dependencies:

"@digitalcredentials/dcc-context": "^1.0.0"

Usage

import dccCtx from '@digitalcredentials/dcc-context';
// or
const dccCtx = require('@digitalcredentials/dcc-context');
const {contexts, constants, appContextMap} = dccCtx;

dccCtx.CONTEXT_URL_V1
// 'https://w3id.org/dcc/v1'

// get context data for a specific context
dccCtx.CONTEXT_V1
// full context object

This package can be used with bundlers, such as webpack, in browser applications.

API

The library exports the following properties:

  • CONTEXT_URL_V1 and CONTEXT_V1.
  • appContextMap: For use with cborld library.

Developing

WARNING: The .json file in v1/ is auto-generated by the npm run build script, each time you run the test suite.

DO NOT edit it directly (or your changes will be quickly overwritten). Instead, make all context changes to js/context.js.

License

版本与发布记录

@digitalcredentials/dcc-context 共发布 1 个版本,首次发布于 2022/01/20;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.0.0latest2022/01/204 年前

关于 @digitalcredentials/dcc-context 的常见问题

@digitalcredentials/dcc-context 是什么?

DCC core JSON-LD context.

如何安装 @digitalcredentials/dcc-context?

在项目目录运行 npm install @digitalcredentials/dcc-context,或使用 pnpm add / yarn add / bun add。

@digitalcredentials/dcc-context 支持 TypeScript 吗?

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

@digitalcredentials/dcc-context 支持 ESM 还是 CommonJS?

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

@digitalcredentials/dcc-context 可以商用吗?

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

@digitalcredentials/dcc-context 的下载量有多少?

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

@digitalcredentials/dcc-context 还在维护吗?

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