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

citeproc-cli

v0.3.0

Published

Simple cli for citeproc-js

Downloads

5

Readme

citeproc-cli

Requires node>=12.0.0

Rather simplistic command line wrapper around citeproc-js. It can be packaged by pkg to provide citeproc functionality with a simple api in a portable form.

Since my use case is a Markdown conversion library, this tool renders citations and bibliography as HTML.

Flags

--data/-d

Required

Path to a text file containing your bibliographic library in CSLJSON.

--style/-s

Required

Path to a CSL file containing your bibliographic style in XML format.

--bibliography/-b

Default: false

Render bibliography (omit to render citations to use in footnotes/endnotes)

--localedir/-j

Default: ./locales

Path to a directory containing CSL locale files in XML format. Ideally, this directory would be a clone of the CSL locale repository.

--locale/-l

Default: en-US

Desired locale as RFC 5646 compliant string.

--keys/-k

Default: []

JSON-serialized list containing cited keys (without a preceding @). Either wrap in single quotes (which should always be possible since allowed characters in CSL keys are limited) or avoid white space. One list entry can contain multiple keys separated by ;. This flag is overridden by --references/-r and --reffile/-p.

Example:

citeproc-cli -k '["citekey1", "citekey2;citekey3", "citekey4"]'

--references/-r

Default: []

JSON serialized array of arrays of dictionaries containing references. Every dictionary must contain at least the key ìd (value: citekeys without a preceding @) but can contain additional keys to pass to the citation processor. The deserialized dictionaries are directly passed as citationItems and can therefore contain any of the keys mentioned in the citeproc-js documentation. Each array of dictionaries is treated as one citation. This flag overrides --keys/-k and is overridden by --reffile/-p.

Example:

citeproc-cli -r '[[{"id": "citekey1", "prefix": "ct."}, {"id": "citekey2", "suffix": "p. 16"}], [{"id": "citekey1"}]]'

--reffile/-p

Default: null

Path to a file containing the same JSON serialized data you would pass with --references/-r. While probably a little slower than the former, it's useful for bigger data sets or if you don't want to mess with escaping. This flag overrides --keys/-k and --references/-r.

--uncited/-u

Default: []

JSON-serialized list containing uncited keys to add to bibliography (without a preceding @). Either wrap in single quotes (which should always be possible since allowed characters in CSL keys are limited) or avoid white space. One list entry can contain multiple keys separated by ;

Example:

citeproc-cli -u '["citekey1", "citekey2;citekey3", "citekey4"]'

--nojson/-n

Default: false

Debugging option: Don't JSON-stringify output to make STDOUT a bit easier to read.

Error codes

Packaging

Run pkg on the package:

npm install .
npm install --only=dev .
./node_modules/.bin/pkg .

Optionally, use the --target attribute to build for a system/architecture that is not mentioned in package.json.