measurement-toolkit
    TypeScript icon, indicating that this package has built-in type declarations

    0.4.0 • Public • Published

    Measurement Toolkit

    Perform math operations and conversions on object-oriented weights & measurements.

    Build Status codecov Gitter

    Basic Usage

    Conversion

    import {Gram} from "measurement-toolkit";
     
    const grams = new Gram(245);
    const ounces = grams.to.Ounce();
     
    > Ounce {
    >   value: 8.6421206776472
    > }

    Math operations

    Example

    import {Kilogram, TroyOunce} from "measurement-toolkit";
     
    const kgs = new Kilogram(5);
    const toz = new TroyOunce(3);
     
    kgs.subtract(toz);
     
    > Kilogram {
    >   value: 4.9066895696
    > }

    API

    Unit support

    Measure System Units
    Mass SI Yoctogram, Zeptogram, Attogram, Femtogram, Picogram, Nanogram, Microgram, Milligram, Centigram, Decigram, Gram, Decagram, Hectogram, Kilogram, Megagram, Gigagram, Teragram, Petagram, Exagram, Zettagram, Yottagram
    US Avoirdupois Grain, Dram, Ounce, Quarter, Hundredweight, Pound, AvoirdupoisTon
    Troy TroyOunce, TroyPound
    Length SI Yoctometer, Zeptometer, Attometer, Femtometer, Picometer, Nanometer, Micrometer, Millimeter, Centimeter, Decimeter, Meter, Decameter, Hectometer, Kilometer, Megameter, Gigameter, Terameter, Petameter, Exameter, Zettameter, Yottameter
    US Yard, Inch, Foot, Mile
    Time SI Yoctosecond, Zeptosecond, Attosecond, Femtosecond, Picosecond, Nanosecond, Microsecond, Millisecond, Centisecond, Decisecond, Second, Decasecond, Hectosecond, Kilosecond, Megasecond, Gigasecond, Terasecond, Petasecond, Exasecond, Zettasecond, Yottasecond
    Other Minute, Hour, Day

    Installation

    npm i measurement-toolkit
    

    API Documentation

    npm run build:docs
    

    Testing

    Run tests

    npm test
    

    Run Linter

    npm run lint
    

    Coverage

    Run tests with coverage

    npm run test:coverage
    

    Coverage graph

    Code Coverage

    Install

    npm i measurement-toolkit

    DownloadsWeekly Downloads

    29

    Version

    0.4.0

    License

    BSD-3-Clause

    Unpacked Size

    1.01 MB

    Total Files

    330

    Last publish

    Collaborators

    • baspeeters