Nutrifacts.js is a library to extract and calculate nutrition facts, on several levels of detail; the library is capable of processing natural language strings and retrieving information using precise inputs (IDs or labels).
Quick example: https://repl.it/@MarcelloBarile/Nutrifactsjs
@param ingredients -- The list of ingredients. Supports NLP queries (recipeStr) or precise values (label & quantity).
getNutrientsInRecipe(ingredients: IInputIngredient[])
@param query -- The query to match.
getFoodByQuery(query: string, injectNutrients: boolean)
@param query -- The nutrients query to match.
getNutrientsByQuery(query: string)
@param id -- The food ID.
getFoodById(id: string)
@param ingredientsIds -- The list of ingredients' IDs to match. @param operator -- The logic operator to be applied when matching the ingredients.
getFoodsByIngredients(ingredientsIds: number[], operator: LOGIC_OPERATOR)
@param query -- The properties query to match.
getFoodsByProperties(query: string)
$ npm install nutrifacts
or
$ yarn add nutrifacts
See CONTRIBUTING.md
See TODOs.md
See CHANGELOG.md
UNLICENSED