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)
})
Supported input and output
Identifiers
Formats | Resolver | Plugin |
---|---|---|
DOIs (Digital Object Identifiers) | DOI Content Negotiation | @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 and npm package URLs | GitHub v3 API and npm registry | @citation-js/plugin-software-formats |
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 |
.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 |
CFF (Citation File Format), Zenodo Deposit JSON | check_circle | check_circle | @citation-js/plugin-software-formats |
Citation Style 1 templates of the English Wikipedia | highlight_off | check_circle | @citation-js/plugin-wikipedia-templates |
Usage
- @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.
In the wild
- PubPub, a platform for open publishing.
- Scholia, an interface that displays and augments data from Wikidata.
- wcite, a CLI for fetching and managing bibliographic records from Wikidata.
- Reference Extractor, an online tool to extract references from Microsoft Word and LibreOffice documents.
- Forgejo, a self-hosted Git server.
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