npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@citation-js/cli

v0.7.16

Published

CLI for Citation.js

Downloads

7,696

Readme

@citation-js/cli

CLI for Citation.js.

NPM version NPM total downloads License Dependency status

Install

npm install --global @citation-js/cli

Usage

Usage: citation-js [options]

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

  -i, --input <path>                 Input file. If all input options are omitted, it uses stdin
  -t, --text <string>                Input text. If all input options are omitted, it uses stdin
  -u, --url <string>                 Deprecated in favor of -t, --text. If all input options are omitted, it uses stdin
  -o, --output <path>                Output file (omit file extension). If this option is omitted, the output is written to stdout
  --pipe                             Pipe and transform from stdin to stdout

  -R, --output-non-real              Output as a text file
  -f, --output-type <option>         Output structure type: string, html, json (default: "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) (default: "csl")
  -l, --output-language <option>     Output language. [RFC 5646](https://tools.ietf.org/html/rfc5646) codes (default: "en-US")

  --log-level <level>                Log level: silent, error, warn, info, debug, http (default: "warn")

  --plugins <names>                  Plugin names (@citation-js/plugin-NAME); bibjson, bibtex, csl, doi, ris & wikidata are preloaded (default: [])
  --plugin-config <config>           @plugin.property.path=value;... (default: [])
  --formatter-options <config>       property.path=value;... (default: [])

  --no-input-generate-graph          Do not include the parsing graph in CSL output
  --input-force-type <type>          Force parsing as a certain type
  --input-max-chain-length <number>  Set the maximal number of parsing iterations
  --no-input-strict                  Do not use the strict parsing mode
  --input-target <type>              Stop parsing when a certain type is reached

Input

Input can be read from stdin, passed as a file with -i, --input <path> or, for simple IDs, as plain text with -t, --text or the deprecated alias -u, --url.

$ echo "Q30000000" > input.txt

$ cat input.txt | citation-js
[{"title": "The Synergistic Activity ...", ...}]

$ citation-js --input input.txt
[{"title": "The Synergistic Activity ...", ...}]

$ citation-js --text Q30000000
[{"title": "The Synergistic Activity ...", ...}]

Output

The CLI outputs to stdout by default, but can write to a file with the -o, --output option.

$ citation-js --text Q30000000
[{"title": "The Synergistic Activity ...", ...}]

$ citation-js -t Q30000000 -o output
$ more output.json
[{"title": "The Synergistic Activity ...", ...}]

Note: the file extension is determined automatically, and should therefore be omitted in the -o option. To force a file extension, simply omit -o and redirect stdout to the preferred file.

Output Format

To format the output, use the -R, -s, -f and -l options. These options map to the old output options.

| CLI option | Default value | Other values | |-------------------------|------------------|----------------------| | -R, --output-non-real | omitted (real) | present (string, plain text) | | -f, --output-type | json | json, string | | -s, --output-style | csl | citation-*, bibtex, bibtxt, data | | -l, --output-language | en-US | es-ES, fr-FR, du-DU, nl-NL |

For example, to format doi:10.5281/zenodo.1005176 in French in the APA format:

$ citation-js -t 10.5281/zenodo.1005176 -f string -s citation-apa -l fr-FR

Willighagen, L., & Willighagen, E. (2017,  octobre 9). Larsgw/Citation.Js V0.3.3. Zenodo. https://doi.org/10.5281/zenodo.1005176