Measurement.js
A measurement library for handling, converting, and manipulating quantities.
Documentation
Getting Started
Node
In order to install measurement
in your project, navigate to your projects directory and install with:
npm install measurejs
You can include measurement
within a module in a standard way:
var m = ;;
Browser
Bower
bower install --save measurement
Require.js
require;;
NuGet
Coming Soon!
Basic Usage
You can use measurement
to perform basic math:
value; // 9value; // 14 value; // 1.5value; // 14 value; // 12value; // 0.4
You can use measurement
to perform unit conversions:
value; // 120value; // 39.3701
You can perform math between quantities with different units:
value; // 150 [in minutes]
You can chain operations:
value; // 23.5
Units & Systems
Coming Soon!
Quantities & Dimensions
Coming Soon!
Format
Coming Soon!
Uncertainity & Frequency Distribution
Coming Soon!
Config Options
Coming Soon!
Changelog
0.0.1
Initial release
Build Process
We use gulp to provide our build process with a couple of custom extensions to provide the custom behaviours. The build process completes these steps:
- Convert
./common/systems.json
into three files of varying levels of detail.
full
- Contains all systems and all units.default
- Contains all systems and all that aren't listed as historical or rare.minimal
- Contains a subset of systems and all units with the systems usCustomary, imperial, or si.- Does not include historical or rare units.
- Systems: length, area, volume, speed, acceleration, pressure, mass, time, temperature, energy, density, and information.
- Convert each of the files into JS syntax and insert into
measurement.js
file with the name./built/measurement_\*.js
. - Minify each of the built files into
./min/measurement_\*.min.js
.
License
Measurement JS is freely distributable under the terms of the MIT license.