Ingredient Math
This library is for converting recipe ingredients based on a serving size factor.
Installation
yarn add ingredient-math
Example
; const ingredient = "1 teaspoon sugar"const servingsFactor2 > quantity: "2" unit: "teaspoons" ingredient: "sugar"
It will also automatically calculate and convert units:
; const ingredient = "1 teaspoon sugar"const servingsFactor3 > quantity: "3" unit: "tablespoons" ingredient: "sugar"