@nvif1989/codes
v1.0.3
Published
Uniquely identifiable codes for each food.
Downloads
14
Maintainers
Readme
Uniquely identifiable codes for each food.
This is part of package nvif1989. Source: Nutritive Value of Indian Foods 1989.
const codes = require('@nvif1989/codes');
// codes.corpus: Map {name => {name, code}}
// codes.load(): Promise (corpus loaded)
// codes.sql([table], [options]): Promise (sql commands)
// codes.csv(): path to csv file
// codes(<query>)
// -> [{name, code}] for matched food names
async function main() {
await codes.load();
/* load corpus first */
codes('hing');
// [ { name: 'Hing (B.,G.,H.,Mar.,P.)', code: '215' } ]
codes('atta');
// [
// { name: 'Valia atta (Mal.)', code: '384' },
// { name: 'Atta (B.,H.,O.)', code: '21' },
// { name: 'Am-ka-guthli-ka-atta (H.)', code: '546' }
// ]
}
main();
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.