This is a simple wrapper for the Nutritionix API.
Nutritionix is a database of nutrition facts of every food item.
npm install nutritionix
To use this package you need to get API keys form Nutritionix API portal.
The documentation of the API could be found here
var Nutritionix = require('./lib/nutritionix');
var nutri = new Nutritionix('YOUR_API_KEY','YOUR_APP_ID');
//Search for a brand named coca-cola
nutri.searchBrand({query:"coca-cola"},function(result){
console.log(result);
});
//Search nutrition fact of an item with barcode = 52200004265
// here it corresponds to Bay cereals for Beet nuts brand
nutri.getItemByUPC("52200004265",function(result){
console.log(result);
});