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

cite-format

v0.0.6

Published

Describe citation formats easily and accurately.

Downloads

4

Readme

Cite Format

Cite Format is an intuitive way of accurately and exhaustively describing the arrangement of source information within citations. Here's an example APA book format:

^AUTHOR. (YEAR). <i>TITLE</i> (TRANSLATOR,+Trans.) . EDITOR,+Ed(s). LOCATION: PUBLISHER.

This defines output citations of the form:

  • Chomsky, Noam. (1965). Aspects of the theory of syntax. Cambridge, MA: MIT Press.
  • Nietzsche, Friedrich. (1969). Genealogy of Morals (Walter Kaufmann, Trans.). Random House.

Syntax

There are 5 syntactic categories:

  1. boundaries: spaces ( ) and backslashes ( \ )
  2. modifiers: carets ( ^ ), tildes ( ~ ), and bars ( | )
  3. fields: uppercase strings of 3+ uppercase letters ( AUTHOR ), plus modifiers
  4. punctuation: any combination of: ,.:[]()"'
  5. extras: arbitrary strings, with whitespace represented by plus ( + ) symbols

There are 3 rules of composition:

  1. If no boundary intervenes among n elements, they're attached.
  2. Fields do not attach to one other.
  3. Modifiers must attach to a field.

On attachment

An element is said to be attached to a field if no boundaries intervene between the field and the element. In the below, the extras (HTML tags) and the punctuation are attached to the TITLE field:

<i>(TITLE).</i>

In the next case, the parentheses attach to the ISSUE field, and not to the VOLUME or PAGENUMBERS fields, since a backslash (a boundary) intervenes on the left, and a space (a boundary) intervenes on the right.

VOLUME\(ISSUE). PAGENUMBERS.

Semantics

Field interpolation and modifiers

Fields are replaced with strings; AUTHOR becomes Noam Chomsky.

If a caret appears at the left edge of a name field, the (alphabetically) first name will appear inverted. So, ^AUTHOR becomes Chomsky, Noam.

If a tilde appears at the left edge of a name field, all first names will be dropped, and if more than 2 names, names 2+ will be replaced by et al.

The bar modifier turns n fields into a single disjoint field, in which the leftmost non-empty value replaces the whole field. So AUTHOR|EDITOR will be replaced by the value of AUTHOR if defined, or else with the value of EDITOR.

Attachment

Elements attached to an empty field are dropped. So then, if FIELDA evaluates as 'Chomsky', and FIELDB evaluates as empty:

# Attached period
FIELDA FIELDB.  # = 'Chomsky'

# Un-attached period
FIELDA FIELDB . # = 'Chomsky.'

In the first case, the attached period vanishes because FIELDB is empty, while in the second case, the un-attached period remains. The same applies for extras.

Punctuation filter

The output will satisfy the following:

  • Empty enclosing punctuation ( "" '' () [] ) is dropped.
  • Bad periods ( .. (. [. ) are dropped.
  • Bad commas ( ,, ,. (, [, :, ,) ,] ) are dropped.
  • Bad colons ( :: :. (: [: ,: :) :] ) are dropped.