Skip to content

nvif1989/codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();

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.