1.0.2 • Published 6 years ago

homestar-uom-imperial v1.0.2

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
6 years ago

homestar-uom-imperial

Add Imperial (and US) Units of Measure Conversions to IOTDB.

Installation

Install Home☆Star first.

Then:

$ homestar install iotdb-uom-imperial

Usage

Here's a an example of converting meters to nautical miles.

var iotdb = require('iotdb');
var _ = iotdb._;
iotdb.modules(); // this will load extensions

var nms = _.convert.convert({
    from: 'iot-unit:length.si.meter',
    to: 'iot-unit:length.imperial.nautical-mile',
    value: 1000,
});
console.log(nms);

And yards to inches

var inches = _.convert.convert({
    from: 'iot-unit:length.imperial.yard',
    to: 'iot-unit:length.imperial.inch',
    value: 1
});
console.log(inches);

KM to inches

var inches = _.convert.convert({
    from: 'iot-unit:length.si.meter.3', // m * 10^3 = km
    to: 'iot-unit:length.imperial.inch',
    value: 1
});
console.log(inches);

Vocabulary

You can see the imperial vocabulary here. Not all things have conversions written yet - if we're missing anything just let us know (or fork and add it yourself)

1.0.2

6 years ago

1.0.1

6 years ago

0.0.2

8 years ago

0.0.1

8 years ago