Installation
To add this package to your project
yarn add @harvest-profit/units
To use, try the following:
import UnitsHelper from '@harvest-profit/units'
const isCompatibleUnit = UnitsHelper.isCompatibleUnit('lbs', 'tons');
console.log(isCompatibleUnit);
Other useful functions...
UnitsHelper.isLiquidUnit('floz')
UnitsHelper.convertToGallons(8, 'pints')
UnitsHelper.convertToUnit(8, 'pints', 'gallons')
UnitsHelper.convertToUnit(8, 'lbs', 'gallons')
Development
To deploy a new version to NPM, bump the version number, commit/merge to master
, and run the following:
yarn run clean
yarn run build
npm publish --access public
yarn publish --access public
License
This project is MIT licensed