1.0.1 • Published 4 years ago

@infoods/tagnames v1.0.1

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

Food Component Identifiers (Tagnames) by International Network of Food Data Systems (INFOODS).

const tagnames = require('@infoods/tagnames');
// tagnames.corpus: Map {code => {code, name, synonyms, unit, tables, comments, examples}}
// tagnames.load(): true (corpus loaded)
// tagnames.sql([table], [options]): sql commands
// tagnames.csv(): path to csv file
// tagnames(<query>)
// -> [{code, name, synonyms, unit, tables, comments, examples}] for matched tagnames


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

tagnames('vitamin c');
tagnames('c-vitamin');
// [
//   {
//     code: 'VITC',     
//     name: 'vitamin C',
//     synonyms: 'ascorbic acid; ascorbate (Note that these terms are not true synonyms but are often found in food tables to refer to vitamin C.)',
//     unit: 'mg',
//     tables: 'USDA 401, SFK, MW, ETH, IND, NE, EA, PRC, DAN',
//     comments: 'L-ascorbic acid plus L- dehydroascorbic acid.',
//     examples: ''
//   },
//   ...
// ]


tagnames('what is butyric acid?');
tagnames('c4:0 stands for?');
// [  
//   {
//     code: 'F4D0F',
//     name: 'fatty acid 4:0; expressed per quantity of total fatty acids',
//     synonyms: 'butyric acid; tetranoic acid',
//     unit: 'g/100 g fatty acid',
//     tables: 'MW, FRN, DAN, SWD',
//     comments: '',
//     examples: ''
//   },
//   ...
// ]

npm.io npm.io npm.io npm.io

You can ask about composition of 528 key foods in India here: ifct2017.github.io. Food composition values were measured by National Institute of Nutrition, Hyderabad.

1.0.1

4 years ago

1.0.0

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago