Getting Started

Here's a small guide to get you started with Citation.js.


On Node.js, install the package (citation-js) like this:

npm install citation-js

To install the CLI as a global command, do this:

npm install --global citation-js

Browser Releases

Browser release guides are available here. In short, since v0.4.0-7, releases are available through the NPM module, and can be included and/or downloaded like this:

# Specific version

# Latest version (not recommended for prod)

# Unminified

These define require and add citation-js as a module.

<script src="url/to/citation.js" type="text/javascript"></script>
  const Cite = require('citation-js')

Older versions

Most older versions (at least up to v0.3.4) are available like this:

# Unminified

Note that

  • all GitHub builds before version 0.4.0-0 don't work in IE
  • the builds don't transpile dependencies, so don't work in IE either


Read more on the CLI

An example on how to run the CLI:

$ citation-js -t Q30000000 -f html -s citation-apa

This prints a HTML document containing wd:Q30000000 formatted as an APA-styled bibliographic entry.


Read more on Cite

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

const Cite = require('citation-js')

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',
  template: 'apa',
  lang: 'en-US'


To test this code, go to RunKit.