is-vegan

Is-Vegan helps you to find out which food ingredients are vegan / non-vegan

https://github.com/hmontazeri/is-vegan

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.8%) to scientific vocabulary

Keywords

food ingredients npm vegan

Keywords from Contributors

cwl-workflow
Last synced: 9 months ago · JSON representation

Repository

Is-Vegan helps you to find out which food ingredients are vegan / non-vegan

Basic Info
  • Host: GitHub
  • Owner: hmontazeri
  • License: mit
  • Language: TypeScript
  • Default Branch: master
  • Homepage:
  • Size: 415 KB
Statistics
  • Stars: 488
  • Watchers: 12
  • Forks: 34
  • Open Issues: 8
  • Releases: 0
Topics
food ingredients npm vegan
Created over 8 years ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

CircleCI npm version codecov

is-vegan

Is-Vegan helps you to find out which food ingredients are vegan / non-vegan. It can answer that on 1 ingredient or on a list of ingredients. It uses a 850+ entries list of non-vegan ingredients.

How to use?

Why?

We are aware that 'veganism' and the definition of it can be a hot topic. We created the non-vegan list keeping in mind that veganism in dietary terms, it denotes the practice of dispensing with all products derived wholly or partly from animals.

Our first step is the approach to help people understand, which products, and where applicable its ingredients, do not involve, or have involved, the use of any animal product, by-product or derivative. It is not driven about any vegan lifestyle choice or stereotype. We welcome and appreciate any help and concerence regarding the nonvegan/canbevegan list.

Currently we are unfortunatly not adressing any other forms of exploitation of, and cruelty to, animals for clothing, cosmetics or any other purpose.

Thank you all for your comments, we appreciate the discussion, as we grow and learn from your input.

All comments on Hacker News

Sources

We want to make sure that you understand how is-vegan is implemented. We analyzed as many good information websites for vegan / non-vegan ingredients as we found to get a very accurate list of ingredients. However, feel free to send a pull request with an updated version of the list.

Websites we parsed:

and we added also a few ourselves...

Usage

Add

bash yarn add is-vegan

or

bash npm install is-vegan --save

Available Languages

The library supports the following languages using ISO 639-1 codes:

  • en - English (default)
  • it - Italian
  • es - Spanish
  • fr - French
  • de - German

example

```javascript const isVegan = require('is-vegan');

// or

import * as isVegan from 'is-vegan';

// example for single ingredient isVegan.isVeganIngredient('soy'); // true isVegan.isVeganIngredient('milk'); // false

// example for list of ingredients isVegan.isVeganIngredientList(['aspic', 'albumin']); // false isVegan.isVeganIngredientList(['soy', 'cacao butter']); // true

// example for list of ingredients isVegan.containsNonVeganIngredients(['aspic', 'albumin', 'soy']); // ['aspic', 'albumin'] isVegan.containsNonVeganIngredients(['soy', 'cacao butter']); // []

// example for list of ingredients wich contain flagged and non-vegan ingredients isVegan.checkIngredients(['soy', 'cacao butter', 'pork', 'beef', 'glycine']); // returns // { // nonvegan: ['pork', 'beef'], // flagged: ['glycine'] // }

// example for list of ingredients in Italian language isVegan.setIngredientsLanguage('it'); // 'it' is the two-letter ISO 639-1 code for the Italian language isVegan.checkIngredients([ 'manzo', 'maiale', 'glicina', 'biotina', 'soia', 'aglio', ]); // returns // { // nonvegan: ['manzo', 'maiale'], // flagged: ['glicina', 'biotina'] // }

// example for list of ingredients in Spanish language isVegan.setIngredientsLanguage('es'); // 'es' is the two-letter ISO 639-1 code for the Spanish language isVegan.checkIngredients([ 'carne de res', 'cerdo', 'glicina', 'soja', 'ajo', ]); // returns // { // nonvegan: ['carne de res', 'cerdo'], // flagged: ['glicina'] // }

// example for list of ingredients in French language isVegan.setIngredientsLanguage('fr'); // 'fr' is the two-letter ISO 639-1 code for the French language isVegan.checkIngredients([ 'bœuf', 'porc', 'glycine', 'soja', 'ail', ]); // returns // { // nonvegan: ['bœuf', 'porc'], // flagged: ['glycine'] // }

// example for list of ingredients in German language isVegan.setIngredientsLanguage('de'); // 'de' is the two-letter ISO 639-1 code for the German language isVegan.checkIngredients([ 'rindfleisch', 'schwein', 'glyzin', 'soja', 'knoblauch', ]); // returns // { // nonvegan: ['rindfleisch', 'schwein'], // flagged: ['glyzin'] // }

// or

import { checkIngredients } from 'is-vegan';

// example for list of ingredients wich contain flagged and non-vegan ingredients checkIngredients(['soy', 'cacao butter', 'pork', 'beef', 'glycine']);

// returns // { // nonvegan: ['pork', 'beef'], // flagged: ['glycine'] // } ```

real world example

Products searched on USDA Food Composition Databases

```javascript const isVegan = require('is-vegan');

// MOSER ROTH, DARK CHOCOLATE isVegan.isVeganIngredientList([ 'COCOA LIQUOR', 'SUGAR', 'COCOA BUTTER', 'ALKALIZED REDUCED FAT COCOA POWDER', 'SOY LECITHIN EMULSIFIER', 'GROUND VANILLA', ]); // returns true ```

Checkout: RunKit "is-vegan-playground" for more examples

Test

bash yarn test

Updating and translating the lists

The canbevegan and nonvegan English lists are located in the i18n/en directory. The ingredients in these English lists are sorted in alphabetical order.

The lists' translations are located in the corresponding language directory under i18n. The ingredients in these Non-English lists are not sorted in alphabetical order, instead they maintain the order of the English lists.\ So if, for example, the "biotin" ingredient is positioned at line 16 in the English canbevegan list, then its corresponding translation "biotina" in the Italian canbevegan list should also be positioned at line 16.\ If the "bacon" ingredient is positioned at line 49 in the English nonvegan list, then its corresponding translation "pancetta" in the Italian nonvegan list should also be positioned at line 49.

Steps to add a new ingredient to the lists

  1. Add the ingredient to the canbevegan or nonvegan English list, ensuring that the list alphabetical order is preserved.
  2. Add the translated ingredient to each of the existing Non-English lists at the same line number as the ingredient appears in the corresponding English list.

Steps to translate the lists to a new language

  1. Create a directory with the two-letter code (ISO 639-1) of the new language.
  2. Translate the English lists to the new language and save these to newly created list files under the new language directory. Ensure that the ingredients in each of these new list files appear in the same order as in the corresponding English list.

Thanks for translating the lists to italian

gianantoniopini

Alfred Workflow by Kyle Brumm (kjbrum)

alfred-is-vegan

TODO

  • extend list

Authors

  • Hamed Montazeri
  • Meike Rittmeier

Owner

  • Name: Hamed Montazeri
  • Login: hmontazeri
  • Kind: user

Born in 🇮🇷 raised in 🇩🇪

GitHub Events

Total
  • Issues event: 2
  • Watch event: 9
  • Delete event: 24
  • Issue comment event: 14
  • Push event: 26
  • Pull request review event: 1
  • Pull request event: 38
  • Create event: 13
Last Year
  • Issues event: 2
  • Watch event: 9
  • Delete event: 24
  • Issue comment event: 14
  • Push event: 26
  • Pull request review event: 1
  • Pull request event: 38
  • Create event: 13

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 188
  • Total Committers: 17
  • Avg Commits per committer: 11.059
  • Development Distribution Score (DDS): 0.559
Past Year
  • Commits: 22
  • Committers: 4
  • Avg Commits per committer: 5.5
  • Development Distribution Score (DDS): 0.455
Top Committers
Name Email Commits
Hamed Montazeri h****i@m****m 83
Hamed Montazeri h****n@g****m 25
Hamed Montazeri h****i@u****m 22
gianantoniopini 6****i@u****m 19
dependabot[bot] 4****]@u****m 14
mikamkr 3****r@u****m 5
Hamed Montazeri m****a@H****l 4
Annalise Tarhan a****n@g****m 3
Charles Koehl c****s@e****m 3
Abigail a****l@a****e 2
Victor Glindås g****s@g****m 2
Hani 5****y@u****m 1
Justin Holdstock j****1@g****m 1
Sutrisno Suryajaya s****p@g****m 1
bjarkt b****t@o****g 1
dependabot[bot] d****]@u****m 1
google-labs-jules[bot] 1****]@u****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 18
  • Total pull requests: 59
  • Average time to close issues: 12 months
  • Average time to close pull requests: about 1 year
  • Total issue authors: 14
  • Total pull request authors: 14
  • Average comments per issue: 2.61
  • Average comments per pull request: 1.37
  • Merged pull requests: 31
  • Bot issues: 0
  • Bot pull requests: 40
Past Year
  • Issues: 0
  • Pull requests: 15
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.8
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 13
Top Authors
Issue Authors
  • leemi (2)
  • fluxsauce (2)
  • kjbrum (2)
  • teolemon (2)
  • hjek (1)
  • underyx (1)
  • TobiToxota (1)
  • petitpingouinfluffy (1)
  • bladespinner (1)
  • jonathanronen (1)
  • endevagames (1)
  • lucasrodes (1)
  • msuntharesan (1)
  • k4pran (1)
Pull Request Authors
  • dependabot[bot] (63)
  • gianantoniopini (6)
  • hmontazeri (3)
  • annalisetarhan (2)
  • Glinkis (2)
  • JustinHoldstock (2)
  • bjarkt (1)
  • sutris (1)
  • Abigail (1)
  • yochum (1)
  • mikamkr (1)
  • charleskoehl (1)
  • hanimay (1)
  • jarrett-m (1)
Top Labels
Issue Labels
help wanted (9) enhancement (7) question (1)
Pull Request Labels
dependencies (63) javascript (26)

Packages

  • Total packages: 1
  • Total downloads:
    • npm 64 last-month
  • Total dependent packages: 3
  • Total dependent repositories: 5
  • Total versions: 35
  • Total maintainers: 1
npmjs.org: is-vegan

Is-Vegan is a library which helps you to find out which ingridiends are not vegan

  • Versions: 35
  • Dependent Packages: 3
  • Dependent Repositories: 5
  • Downloads: 64 Last month
Rankings
Stargazers count: 3.2%
Forks count: 4.3%
Dependent repos count: 5.2%
Dependent packages count: 5.8%
Average: 6.9%
Downloads: 16.3%
Maintainers (1)
Last synced: 9 months ago

Dependencies

package.json npm
  • babel-cli 6.26.0 development
  • babel-core 6.26.0 development
  • babel-eslint 8.2.1 development
  • babel-jest 22.1.0 development
  • babel-loader 7.1.2 development
  • babel-polyfill 6.26.0 development
  • babel-preset-env 1.6.1 development
  • babel-preset-es2015 6.24.1 development
  • babel-preset-latest 6.24.1 development
  • babel-preset-stage-2 6.24.1 development
  • eslint 4.15.0 development
  • eslint-config-standard 11.0.0-beta.0 development
  • eslint-loader 1.9.0 development
  • eslint-plugin-import 2.8.0 development
  • eslint-plugin-node 5.2.1 development
  • eslint-plugin-promise 3.6.0 development
  • eslint-plugin-standard 3.0.1 development
  • jest 22.1.4 development
  • nodemon 1.14.11 development
  • uglifyjs-webpack-plugin 1.1.8 development
  • webpack 3.10.0 development
  • webpack-node-externals 1.6.0 development
yarn.lock npm
  • 854 dependencies