0.2.0 • Published 6 years ago

weighable v0.2.0

Weekly downloads
878
License
MIT
Repository
github
Last release
6 years ago

Weighable (JS)

A library for dealing with weights in Javascript.

Installation

npm install --save weighable

OR

yarn add weighable

Usage

Using the Weight class is as simple as:

import { Weight, GRAM, OUNCE } from 'weighable';

let weight = new Weight(1, GRAM);
weight = weight.plus(new Weight(1, OUNCE));
weight = weight.round(4);

It gets even cleaner when you use the helper methods:

import { grams, ounces } from 'weighable';

let weight = grams(1);
weight = weight.plus(ounces(1));
weight = weight.round(4);

Testing

yarn install
yarn jest
0.2.0

6 years ago

0.1.0

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago