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 🙏

© 2026 – Pkg Stats / Ryan Hefner

citation-core

v1.2.0

Published

A Framework for generating a citation from several sources

Readme

citation-core

CitationCore is a framework designed to genreate a citation string given a URL to a code source like a GitHub or Bitbucket repository. It is part of a larger effort, lead by Mozilla Science Lab, to develop a suite of tools that aim to implement a standard for citing software and making it easier to cite software correctly. To learn more about this project you can visit the Software Citation Tools repository.

Install

CitationCore is distributed through npm. To install:

npm install citation-core

Contributor Install

If you are interested in contributing to citation-core please follow these install instructions. They will add a pre-commit hook that will run our linter and reject commits that do not meet the project's coding standards. We are adhereing to the AirBnb style guide.

git clone https://github.com/mozillascience/CitationCore.git
cd CitationCore
cp dev/pre-commit .git/hooks/

Usage

To generate a citation you must provide at least a url.

const CitationCore = require('citation-core');

let formatOptions = new CitationCore.FormatOptions();
formatOptions.url = 'http://github.com/apple/swift';

CitationCore.generate(formatOptions, (citationStr, errors) => {
	// Handle completion of citation generation
});

Citation Output:

Lattner, C., Gregor, D. & Gribenko, D. (2017). "swift". Version: Swift 3.0.1 Preview 3. Retrieved From: https://swift.org/ 

FormatOptions

The generate function requires an instance of the FormatOptions class. This class allows for customization of the output citation. The FormatOptions object has the following customizable properties:

URL

The url of the code source. Currently the framework supports GitHub.

formatOptions.url = 'http://github.com/scipy/scipy';

Style

The style template of the output citation. The framework currently supports the following formats:

  • apa
  • chicago
  • bibtexMisc
  • biblatexSoftware
formatOptions.style = CitationCore.styles.apa;

API Token

A token field for GitHub OAuth. Required for GitHub URL's.

Errors

The callback for the generate function second parameters is an array of errors. Not all errors are created equal. Some errors are critical and will halt generation, however some will be a warning. In this case the citation genreation will complete. If the citationStr parameter is null a critical error has occured.

API Documentation

API Documentation is viewable on github pages or locally in the docs directory.