A extensible unit conversion library for Node.JS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

14 lines
317 B

var units = require('../../');
console.dir(units.getUnitType('gallons'));
console.dir(units.getUnitType('milliliters'));
var result = units.convert('20 quarts to gallons');
console.log(result === 5);
try{
var value = units.convert('5 days to gallon');
console.log(value);
} catch(e){
console.log(e);
}