Package Exports
- @nvif1989/codes
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@nvif1989/codes) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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.