@danielsimonjr/mathts-units
v0.1.2
Published
Standalone units & dimensional-analysis for MathTS -- the Unit class, unit registry, and SI prefixes, re-exported as a focused package
Maintainers
Readme
@danielsimonjr/mathts-units
Standalone units & dimensional analysis for MathTS.
A focused entry point over the unit system in
@danielsimonjr/mathts-core.
The implementation is re-exported, not duplicated.
Install
npm install @danielsimonjr/mathts-unitsWhat it exports
Unit-- dimensional quantity class (new Unit(5, 'km')), with.to(),.toBest(),.value,.type.isUnit/isUnitValue-- type guards.DimensionMismatchError,UnitParseError-- error types.- Registry:
BASE_UNITS,DERIVED_UNITS,ALL_UNITS,UNIT_ALIASES,getUnitDef. - Prefixes:
SI_PREFIXES,BEST_PREFIXES,getPrefix. DIMENSIONLESS,dim, and theDimensions/UnitDeftypes.
import { Unit } from '@danielsimonjr/mathts-units';
new Unit(100, 'km/h').to('m/s').value; // 27.777...License
MIT (c) Daniel Simon Jr.
