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

@quantities/units

v1.0.0

Published

Uncommon and specialized unit definitions for @quantities/core

Readme

@quantities/units

A set of uncommon or specialized unit definitions for @quantities/core.

Use with @quantities/registry to build a Quantity constructor that understands them. Once the units are registered, the same Quantity class will carry them everywhere.

Install

npm install @quantities/units @quantities/registry
bun add @quantities/units @quantities/registry

Importing

Everything is importable from the package root, so you needn't know which kind a unit belongs to. Individual units, kind groups (arrays of unit entries), and ALL (every unit) are named exports. Collections are spelled in uppercase to set them apart from lowercase units:

// import all units
import UNITS from "@quantities/units";
// import only length units
import { LENGTH } from "@quantities/units";
// import a single unit
import { league } from "@quantities/units";

Each kind is also a separate entry point. There, the default export is the whole kind, and named exports are individual units:

// import every length unit
import LENGTH from "@quantities/units/length";
// import specific units only
import { league, furlong } from "@quantities/units/length";

Using with a registry

Pass the imported definitions to createRegistry(), then bind a constructor with withRegistry():

import LENGTH from "@quantities/units/length";
import SPEED from "@quantities/units/speed";
import { createRegistry, withRegistry } from "@quantities/registry";

// LENGTH's hubbleLength references a speed unit, so register SPEED alongside it
const registry = createRegistry([LENGTH, SPEED]);
const { default: Quantity } = withRegistry(registry);

Quantity("3 leagues").to("km").format(); // → "14.484 km"

createRegistry accepts an array of arrays, so you can combine any kinds:

import PREFIX from "@quantities/units/prefix";

const registry = createRegistry([LENGTH, SPEED, PREFIX]); // adds "googol"

Available kinds

Each kind (uppercase) lists the units importable under it.

  • ACCELERATION
    • gal
  • ACTIVITY
    • katal
    • unit
  • ANGLE
    • gradian
  • CHARGE
    • elementaryCharge
  • COUNTING
    • cell
    • basePair
    • nucleotide
    • molecule
  • CURRENT
    • biot
    • abampere
  • ENERGY
    • erg
    • thermUS
    • electronvolt
  • FORCE
    • dyne
    • gramForce
  • LENGTH
    • league
    • mil
    • furlong
    • rod
    • fathom
    • lightMinute
    • lightSecond
    • datamile
    • hubbleLength
    • redshift
  • MAGNETISM
    • gauss
    • maxwell
    • oersted
  • MASS
    • grain
    • slug
    • dram
    • dalton
    • amu
  • MOLAR_CONCENTRATION
    • wtpercent
  • POWER
    • voltAmpereReactive
  • PREFIX
    • googol
  • PREFIX_ONLY
    • ppt
    • ppq
    • gross
  • PRESSURE
    • cmH2O
    • inH2O
  • RADIATION
    • roentgen
    • curie
  • RATE
    • cpm
    • dpm
  • SPEED
    • cee
    • hubbleConstant
    • hubbleConstant70
  • TEMPERATURE
    • rankine
    • tempR
  • TIME
    • fortnight
  • VISCOSITY
    • poise
    • stokes
  • VOLUME
    • tablespoonInt
    • teaspoonInt
    • beerbarrelImp
    • bushel
    • oilbarrel
    • beerbarrel

License

MIT