@citation-js/core

中文文档
0.9.0发布于 2026/09/18MITTypeScriptESM + CJS近 30 天下载 35.5万

Convert different bibliographic metadata sources

原始使用文档
文档目录5 节
  1. Install
  2. Usage
  3. Getting Started
  4. Cite
  5. Async

@citation-js/core

Convert different bibliographic metadata sources.

NPM version NPM total downloads License Dependency status

Install

npm install @citation-js/core

Usage

Getting Started

You can read a guide on how to get started, together with some tutorials and examples, here.

Cite

More info

To use the Cite constructor, require() the module like this:

const {Cite} = require('@citation-js/core')

For example, to get the bibliographical data of the Wikidata item wd:Q21972834, and then format it in HTML, English and APA:

let example = new Cite('Q21972834')

let output = example.format('bibliography', {
  format: 'html',
  style: 'apa',
  lang: 'en-US'
})

console.log(output)

To test this code, go to RunKit.

Async

Use the async API (recommended for Wikidata, URL, and DOI input) like this:

let example = await Cite.async('Q21972834')

let output = example.format('bibliography', {
  format: 'html',
  style: 'apa',
  lang: 'en-US'
})

console.log(output)

Cite.async() also supports options as the second argument, and a callback function as last argument.

版本与发布记录

@citation-js/core 共发布 49 个版本,首次发布于 2018/12/07;过去 12 个月发布了 4 个版本。

版本发布日期距今
0.9.0latest2026/09/181 个月前
0.8.22026/07/133 个月前
0.8.12026/07/064 个月前
0.8.02026/07/064 个月前
0.7.212025/10/201.1 年前
0.7.182025/01/281.8 年前

关于 @citation-js/core 的常见问题

@citation-js/core 是什么?

Convert different bibliographic metadata sources

如何安装 @citation-js/core?

在项目目录运行 npm install @citation-js/core,或使用 pnpm add / yarn add / bun add。

@citation-js/core 支持 TypeScript 吗?

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

@citation-js/core 支持 ESM 还是 CommonJS?

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

@citation-js/core 需要什么版本的 Node.js?

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

@citation-js/core 可以商用吗?

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

@citation-js/core 的下载量有多少?

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

@citation-js/core 还在维护吗?

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