Convert fuel consumption between mpg and l/100km in Node.js
The module currently supports conversions between miles per imperial gallon (mpg) and litres per 100 km.
The project is published to the npm registry, install it via your favourite package manager for node:
npm i mpgconvert
If you wish to use it as a handy tool in your command line, install it globally
npm i -g mpgconvert
As a module
The module has two separate functions exported for conversions.
const mpg l100km =// 7.433711924989639// 45.561460185420366
The package installs a command line executable named
Usage: mpgc <command> [value]Commands:mpg [value] Convert fuel consumption from mpg to l/100km [aliases: m]l100km [value] Convert fuel consumption from l/100km to mpg [aliases: l]Options:--version Show version number [boolean]-h, --help Show help [boolean]
$ mpgc m 485.885021940616797$ mpgc l 5.8548.287359512753206
- Conversion to and from in US mpg