Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pablo-mayrgundter/measure.js
Utility for working with measurements in common units and magnitudes.
https://github.com/pablo-mayrgundter/measure.js
Last synced: 26 days ago
JSON representation
Utility for working with measurements in common units and magnitudes.
- Host: GitHub
- URL: https://github.com/pablo-mayrgundter/measure.js
- Owner: pablo-mayrgundter
- License: apache-2.0
- Created: 2018-04-28T19:01:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-12-30T04:58:47.000Z (almost 3 years ago)
- Last Synced: 2024-09-17T10:44:58.813Z (about 2 months ago)
- Language: JavaScript
- Size: 38.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# measure.js
[![Node.js Package](https://github.com/pablo-mayrgundter/measure.js/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/pablo-mayrgundter/measure.js/actions/workflows/npm-publish.yml)Utility for working with measurements in common units and magnitudes.
Units: meter, gram, second, ampere, kelvin, candela, mole
Magnitudes: Yotta (10^24) - Yocto (10^-24)
Example usage:
```javascript
// Install npm package: npm i @pablo-mayrgundter/measure.js
import Measure from '@pablo-mayrgundter/measure.js/Measure.js';
// or if you clone from git:
// import Measure from './Measure.js';const m1 = Measure.parse('1000m');
const m2 = Measure.parse('1km');
m1.equals(m2); // true
const m3 = new Measure(1, Measure.Magnitude.KILO, Measure.Unit.METER);
m3.equals(m2); // true
```