@cognitedata/units
The @cognitedata/units
is a library that will enable to do units conversion in an easier manner. To check what conversions are available see Dictionaries.
Getting Started
Samples
const input_unit = "ft3/s"
const output_unit = "US_bbl_oil/d"
const res = Number(converter.unitConvert(1, input_unit, output_unit).toPrecision(6))
console.log(`converted unit: \n ${res}`);
More examples can be found at the tests file
Contributing
Contributions welcome! For details about commiting changes, automated versioning and releases, see Contributing.
Testing
Run tests:
npm install
npm test
We use jest
to run tests, see their documentation for more information.
Versioning
The libraries follow Semantic Versioning. Package versions are updated automatically and individually based on commit messages.