Skip to content

RebeccaStevens/uom-types

Repository files navigation

Units of Measure Types

Typesafe units with no runtime overhead.

npm version CI Coverage Status Documentation
code style: prettier GitHub Discussions BSD 3 Clause license Commitizen friendly semantic-release

Donate

Any donations would be much appreciated. 😄

Enterprise Users

uom-types is available as part of the Tidelift Subscription.

Tidelift is working with the maintainers of uom-types and a growing network of open source maintainers to ensure your open source software supply chain meets enterprise standards now and into the future. Learn more.

Installation

# Install with npm
npm install -D uom-types

# Install with pnpm
pnpm add -D uom-types

# Install with yarn
yarn add -D uom-types

Library Structure

This library is split into several submodules.

  • uom-types
    Defines the core types of this library. You'll only need to use if if you are defining your own custom types.

  • uom-types/functions
    Defines runtime mathematical functions that are type-aware of this library's types.

  • uom-types/functions/higher-order
    Defines runtime higher order mathematical functions that are type-aware of this library's types.

  • uom-types/units
    Defines common units.
    Note: does not currently define any imperial types.

  • uom-types/units/converters
    Defines runtime functions for converting between different units of the same UnitClass.

Documentation

Check out RebeccaStevens.github.io/uom-types for the documentation.

Inspiration

Inspired by uom-ts.