Skip to content

nodef/food-additive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a package that allows you to programmatically access E number and INS number data for food additives, including their names, types, and (approval) status.

▌ 📦 JSR, 📰 Docs.



Reference

Method Action
e Find matching food additives with a code/names/type/status query (E number).
ins Find matching food additives with a code/names/type/status query (INS number).


E numbers

E numbers are codes for substances that are permitted to be used as food additives for use within the European Union and EFTA. Commonly found on food labels, their safety assessment and approval are the responsibility of the European Food Safety Authority.

Having a single unified list for food additives was first agreed upon in 1962 with food colouring. In 1964, the directives for preservatives were added, 1970 for antioxidants and 1974 for the emulsifiers, stabilisers, thickeners and gelling agents.


import * as foodAdditive from "jsr:@nodef/food-additive";
// foodAdditive.loadE() → corpus
// foodAdditive.eSql([table], [options]) → SQL statements
// foodAdditive.eCsv() → Path of CSV file
// foodAdditive.e(query)
// → matching [{code, names, type, status}]

await foodAdditive.loadE();
// Load corpus first

foodAdditive.e('E101a');
// → [ { code: 'E101a',
// →     names: 'Riboflavin-5\'-Phosphate',
// →     type: 'color (Yellow-orange)',
// →     status: 'e' } ]

foodAdditive.e('101 a');
// → [ { code: 'E101a',
// →     names: 'Riboflavin-5\'-Phosphate',
// →     type: 'color (Yellow-orange)',
// →     status: 'e' } ]

foodAdditive.e('riboflavin');
// → [ { code: 'E101a',
// →     names: 'Riboflavin-5\'-Phosphate',
// →     type: 'color (Yellow-orange)',
// →     status: 'e' },
// →   { code: 'E106',
// →     names: 'Riboflavin-5-Sodium Phosphate',
// →     type: 'color (Yellow)',
// →     status: '' },
// →   ... ]


INS numbers

The International Numbering System for Food Additives (INS) is a European-based naming system for food additives. It is defined by Codex Alimentarius, the WHO, and the FAO.

Class Names and the International Numbering System for Food Additives, was first published in 1989, with revisions in 2008 and 2011. The INS is an open list, "subject to the inclusion of additional additives or removal of existing ones on an ongoing basis".


import * as foodAdditive from "jsr:@nodef/food-additive";

await foodAdditive.loadI();
// Load corpus first

foodAdditive.ins('102');
// → [ { code: '102',
// →     names: 'tartrazine',
// →     type: 'colour (yellow and orange) (FDA: FD&C Yellow #5)',
// →     status: 'a e' } ]

foodAdditive.ins('ins 102');
// → [ { code: '102',
// →     names: 'tartrazine',
// →     type: 'colour (yellow and orange) (FDA: FD&C Yellow #5)',
// →     status: 'a e' } ]

foodAdditive.ins('ins 160 d (iii)');
// → [ { code: '160d(iii)',
// →     names: 'lycopene, Blakeslea trispora',
// →     type: 'colour',
// →     status: 'a e' },
// →   { code: '160d', names: 'lycopenes', type: '', status: 'a e' },
// →   ... ]


License

As of 23 April 2025, this project is licensed under AGPL-3.0. Previous versions remain under MIT.




ORG