0.7.16 • Published 3 months ago

citation-js v0.7.16

Weekly downloads
3,643
License
MIT
Repository
github
Last release
3 months ago

NPM version NPM total downloads Build Status JavaScript Style Guide

Please use citation-js/citation-js if possible.

citation-js/citation-jsreplaceslarsgw/citation.js
This repository contains the npm package @citation-js/core and several other components.This repository contains the npm package citation-js that wraps the aforementioned components for backwards compatibility.

Install

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 are available here. These define require and add citation-js as a module.

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

Getting Started

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

CLI

More info

Run the CLI like this:

citation-js  [options]

Options:

  -h, --help                      output usage information
  -V, --version                   output the version number

  -i, --input <path>              Input file
  -u, --url <url>                 Input url
  -t, --text <string>             Input text

  -o, --output <path>             Output file (omit file extension)

  -R, --output-non-real           Do not output the file in its mime type, but as a string
  -f, --output-type <option>      Output structure type: string, html, json
  -s, --output-style <option>     Output scheme. A combination of --output-format json and --output-style citation-* is considered invalid. Options: csl (Citation Style Lanugage JSON), bibtex, citation-* (where * is any formatting style)
  -l, --output-language <option>  Output language. [RFC 5646](https://tools.ietf.org/html/rfc5646) codes

Cite

More info

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'
})

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

console.log(output)

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

0.7.16

3 months ago

0.7.15

4 months ago

0.7.14

6 months ago

0.7.13

7 months ago

0.7.12

8 months ago

0.7.11

8 months ago

0.7.10

9 months ago

0.7.9

10 months ago

0.7.8

11 months ago

0.7.7

11 months ago

0.7.6

11 months ago

0.7.5

12 months ago

0.6.9

1 year ago

0.7.2

1 year ago

0.7.1

1 year ago

0.7.4

1 year ago

0.7.3

1 year ago

0.7.0

1 year ago

0.6.8

2 years ago

0.6.7

2 years ago

0.6.6

2 years ago

0.6.5

2 years ago

0.6.3

3 years ago

0.6.4

2 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.7

3 years ago

0.5.4

3 years ago

0.5.6

3 years ago

0.5.5

3 years ago

0.5.3

3 years ago

0.5.2

3 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.5.0-alpha.10

4 years ago

0.5.0-alpha.9

4 years ago

0.5.0-alpha.8

4 years ago

0.5.0-alpha.7

4 years ago

0.5.0-alpha.6

4 years ago

0.5.0-alpha.5

5 years ago

0.5.0-alpha.4

5 years ago

0.5.0-alpha.3

5 years ago

0.5.0-alpha.2

5 years ago

0.5.0-alpha.0

5 years ago

0.4.10

5 years ago

0.4.9

5 years ago

0.4.8

5 years ago

0.4.7

5 years ago

0.4.6

5 years ago

0.4.5

6 years ago

0.4.4

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.4.0-12

6 years ago

0.4.0-11

6 years ago

0.4.0-10

6 years ago

0.4.0-9

6 years ago

0.4.0-8

6 years ago

0.4.0-7

6 years ago

0.4.0-6

6 years ago

0.4.0-5

7 years ago

0.4.0-4

7 years ago

0.4.0-3

7 years ago

0.4.0-2

7 years ago

0.4.0-1

7 years ago

0.4.0-0

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.3.0-14

7 years ago

0.3.0-13

7 years ago

0.3.0-12

7 years ago

0.3.0-11

7 years ago

0.3.0-10

7 years ago

0.3.0-9

7 years ago

0.3.0-8

8 years ago

0.3.0-7

8 years ago

0.3.0-6

8 years ago

0.3.0-5

8 years ago

0.3.0-4

8 years ago

0.3.0-3

8 years ago

0.3.0-2

8 years ago

0.3.0-1

8 years ago

0.3.0-0

8 years ago

0.2.15

8 years ago

0.2.14

8 years ago

0.2.13

8 years ago

0.2.12

8 years ago

0.2.11

8 years ago

0.2.10

8 years ago

0.2.8

8 years ago

0.2.7

8 years ago

0.2.6

8 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago