Citation.js (GitHub, NPM) converts formats like BibTeX, BibJSON, DOI, and Wikidata to CSL-JSON to convert to styles like APA, Vancouver and to BibTeX and RIS.

Read the paper Citation.js: a format-independent, modular bibliography tool for the browser and command line DOI 10.7717/peerj-cs.214 .

NPM version NPM total downloads jsDelivr hits Build Status

Features

Getting started

Install

$ npm install @citation-js/core @citation-js/plugin-doi @citation-js/plugin-doi

Usage

// Load Citation.js
const { Cite } = require('@citation-js/core')
// Load plugins
require('@citation-js/plugin-doi')
require('@citation-js/plugin-csl')

// Parse input
Cite.async('10.7717/peerj-cs.214').then(data => {
  // Format output
  const bibliography = data.format('bibliography', {
    format: 'html',
    template: 'apa',
    lang: 'en-US'
  })
  console.log(bibliography)
})

Example applications

  • @citation-js/replacer, a simple HTML API for Citation.js, to format citations on your page as easily as possible.
  • ISAAC Chrome Extension, a web extension to aid the entry of data regarding publications on the Dutch NWO ISAAC platform.
  • BibTeX generator, easily generate a BiTeX file from various inputs.

Supported input and output

Identifiers

File formats

Formats Input Output Plugin
JSON check_circle check_circle
CSL-JSON check_circle check_circle
BibJSON check_circle highlight_off @citation-js/plugin-bibjson
Formatted bibliographies and citations with CSL and citeproc-js highlight_off check_circle @citation-js/plugin-csl
BibTeX, BibLaTeX, Bib.TXT check_circle check_circle @citation-js/plugin-bibtex
CFF (Citation File Format) check_circle check_circle @citation-js/plugin-cff
.enw files check_circle check_circle @citation-js/plugin-enw
Hayagriva (from Typst) check_circle check_circle @citation-js/plugin-hayagriva
QuickStatements v1 highlight_off check_circle @citation-js/plugin-quickstatements
RIS (1st and 2nd version) check_circle check_circle @citation-js/plugin-ris
refer file format check_circle check_circle @citation-js/plugin-refer
RefWorks tagged format check_circle check_circle @citation-js/plugin-refworks
Citation Style 1 templates of the English Wikipedia highlight_off check_circle @citation-js/plugin-wikipedia-templates
YAML check_circle check_circle @citation-js/plugin-yaml
Zenodo Deposit JSON check_circle check_circle @citation-js/plugin-zenodo

Users

Similar projects & alternatives

How to cite

Willighagen, L. G. (2019). Citation.js: a format-independent, modular bibliography tool for the browser and command line. PeerJ Computer Science, 5, e214. https://doi.org/10.7717/peerj-cs.214