OptionaladditionalAn object that matches the format of unitsOfMeasure. Keys that match any in unitsOfMeasure will be used instead of the default, and any others will be added to the list of known units of measure when parsing ingredients.
OptionalallowIf true, ingredient descriptions that start with "of " will not be
modified. (By default, a leading "of " will be removed from all descriptions.)
OptionaldecimalThe character used as a decimal separator in numeric quantities.
Use "," for European-style decimal commas (e.g., "1,5" for 1.5).
OptionaldescriptionWhen true, each ingredient gets a descriptionMeasurements array holding the
quantity/unit pairs found within its description — e.g. the 1 1/2-inch in
"1 pound beef, cut into 1 1/2-inch cubes".
The description is scanned, not the source line, so the ingredient's own quantity and unit are never re-reported.
OptionaldescriptionWords or patterns to strip from the beginning of ingredient descriptions. Commonly used to remove "of" from phrases like "1 cup of sugar". Strings are matched as whole words followed by whitespace. RegExp patterns are used as-is for more complex matching (e.g., French elisions).
OptionalgroupPatterns to identify group headers (e.g., "For the icing:"). Strings are treated as prefix patterns (matched at the start of the line followed by whitespace). RegExp patterns are used as-is for more complex matching.
OptionalignoreAn array of strings to ignore as units of measure when parsing ingredients.
OptionalincludeIf true, include a meta property on each ingredient containing
the original text, original index, and other metadata.
OptionalleadingWords or patterns to strip from the beginning of a quantity expression. Useful for approximation prefixes like "about 2 cups", "ca. 200 g", or range modifiers like "bis zu 3 EL".
List longer/more-specific patterns before shorter ones (e.g., ['ca.', 'ca']
instead of ['ca', 'ca.']) since regex alternation matches left-to-right.
OptionalmeasurementWhich units count as a description measurement. Has no effect unless
descriptionMeasurements is true.
Note that piece, pinch, large, etc. are real units, so with the default of
'all', "cut into 4 pieces" is a measurement. Use 'convertible' to see only
units convertUnit can act on.
OptionalnormalizeConverts the unit of measure (unitOfMeasure property) of each
ingredient to its long, singular form. For example, "ml" becomes
"milliliter" and "cups" becomes "cup".
OptionalpartialWhen true, if normal whitespace-based parsing fails to identify a unit
of measure, the parser scans the description for known UOM strings
registered via additionalUOMs. Useful for CJK languages where words
are not separated by spaces.
OptionalrangeWords or patterns to identify ranges between quantities (e.g., "1 to 2", "1 or 2"). Strings are matched as whole words followed by whitespace. RegExp patterns are used as-is for more complex matching.
OptionalroundRound parsed quantities to this many decimal places, or false to disable
rounding. Forwarded to numericQuantity.
With the default of 3, "1 11/16" yields 1.688; with false it
yields 1.6875.
OptionaltrailingWords that indicate a trailing quantity extraction context. Used to identify patterns like "Juice of 3 lemons" or "Peels from 5 oranges".
Options available to parseIngredient.