Create a parser; supplied options isolate its cache from the default scope.
Optionalconfig: ParserConfigInputEstimated retention for the cache shared by this configuration.
Immutable effective parser settings.
Release all plans shared by this parser configuration.
Rebuild shared patterns and clear cached definitions after changing unit aliases.
Parse a scalar and counted units without expanding powers.
Expression such as "2 kg*m/s^2", "m", or "2".
Decimal constructor used to evaluate the scalar; defaults to shared Decimal.
A definition accepted by Quantity. Empty sides represent unity.
Legacy parser for scalar and unit expressions without parenthesized grouping. Powers bind first, then dot products; * / and whitespace evaluate from left to right.
Import from
@neutrium/quantity/parsers.js. Pass an instance as the third argument to Quantity constructor, or call parse directly when a parsed definition is needed.Example