Features
- Modular approach: select which formats to include
- Convenient wrapper some of the most common modules
- Preloaded styles and locales for formatted references
- Support for Node.js and the browser
- A command-line interface (CLI)
- MIT licensed
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
| Formats | Resolver | Plugin |
|---|---|---|
| DOIs (Digital Object Identifiers) | DOI Content Negotiation (Crossref, DataCite, etc.) | @citation-js/plugin-doi |
| ISBNs | Google Books API, OpenLibrary API | @citation-js/plugin-isbn |
| PubMed and PMC identifiers | NCBI's Literature Citation Explorer | @citation-js/plugin-pubmed |
| Wikidata QIDs | Wikidata MediaWiki API | @citation-js/plugin-wikidata |
| GitHub repository URLs | GitHub v3 API | @citation-js/plugin-github |
| npm package URLs | npm registry | @citation-js/plugin-npm |
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
-
Forgejo and Gitea,
software for self-hosted Git servers, including
Codeberg, uses this software to format
CITATION.cfffiles. - Getty's Quire, a platform for multiformat publishing.
- NASA's General Coordinates Network website, through the rehype-citation package.
- European Environment Agency's Volto plugin volto-citation, used in their CMS.
- USGS' Analysis Ready Data website.
- World Historical Gazetteer, a platform for spatio-temporal place data.
- Open Science Framework, a platform for various aspects of open science.
- PubPub, a platform for open publishing.
- Scholia, an interface that displays and augments data from Wikidata.
- Quartz, a popular static site generator.
- jsPsych, a framework for browser-based behavioral experiments.
- Galaxy, a platform for data analysis.
- Jupyter Book's MyST, a set of tools for authoring scientific communication.
Similar projects & alternatives
- citeproc-js, the definitive implementation of CSL (also used by @citation-js/plugin-csl).
- Zotero, a manager application for references and associated files, with an extensive set of parsers and scrapers.
- astrocite, a collection of parsers that output CSL-JSON.
- Better BibTeX' bibtex-parser, an impressively extensive Bib(La)TeX parser.
- JabRef, a BibTeX-based reference manager.
- The Bib(La)TeX to CSL converter from Fidus Writer.
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