1.0.5 • Published 4 years ago

@nvif1989/caloriecoefficient v1.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Relative calorie requirement of distinct demographics.

This is part of package nvif1989. Source: Nutritive Value of Indian Foods 1989.

const calorieCoefficient = require('@nvif1989/caloriecoefficient');
// calorieCoefficient.corpus: Map {group => {group, cu}}
// calorieCoefficient.load(): true (corpus loaded)
// calorieCoefficient.sql([table], [options]): sql commands
// calorieCoefficient.csv(): path to csv file
// calorieCoefficient(<query>)
// -> [{group, cu}] for matched groups


calorieCoefficient.load();
/* load corpus first */

calorieCoefficient('children 8 years');
calorieCoefficient('8 years');
calorieCoefficient('8');
// [ { group: 'Children 7 to 9 years', cu: 0.7 } ]

calorieCoefficient('12 years');
calorieCoefficient('12');
// [
//   { group: 'Adolescents 12 to 21 years', cu: 1.0 },
//   { group: 'Children 9 to 12 years', cu: 0.8 }
// ]

calorieCoefficient('adult male');
// [
//   { group: 'Adult male (sedentary worker)', cu: 1.0 },
//   { group: 'Adult male (moderate worker)', cu: 1.2 },
//   { group: 'Adult male (heavy worker)', cu: 1.6 }
// ]

calorieCoefficient('heavy worker');
// [
//   { group: 'Adult male (heavy worker)', cu: 1.6 },
//   { group: 'Adult female (heavy worker)', cu: 1.2 }
// ]

// ->
// cu: Consumption units

nvif1989

You can ask about composition of 592 key foods in India here: nvif1989.github.io. Food composition values were measured by National Institute of Nutrition, Hyderabad. Take a peek at the raw data here: Document, Webpage.