is-vegan

授权协议 MIT License
开发语言 JavaScript
所属分类 Web应用开发、 常用JavaScript包
软件类型 开源软件
地区 不详
投 递 者 束帅
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

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.

Wanna buy me a Coffee?

How to use?

Free API Service?

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

yarn add is-vegan

or

npm install is-vegan --save

example

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']
// }

// 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

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

Free API

https://is-vegan.netlify.com/

Test

yarn test

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
  • Source: https://leetcode.com/contest/weekly-contest-173/problems/filter-restaurants-by-vegan-friendly-price-and-distance/ Given the array restaurants where restaurants[i] = [idi, ratingi, veganFriendl

  • title: “vegan study” author: “hardy huang” date: “2021/3/31” output: html_document knitr::opts_chunk$set(echo = TRUE) R Markdown This is an R Markdown document. Markdown is a simple formatting syntax

  • Description Given the array restaurants where restaurants[i] = [idi, ratingi, veganFriendlyi, pricei, distancei]. You have to filter the restaurants using three filters. The veganFriendly filter will

  • Given the array restaurants where restaurants[i] = [idi, ratingi, veganFriendlyi, pricei, distancei]. You have to filter the restaurants using three filters. The veganFriendly filter will be either tr

  • If we had been straightforward with ourselves, we just like staying peeping tom.The sneakers can be used in each season if canvas is water-proof.It is also suitable for people people thinking of a mor

  • A July 2012 Gallup poll puts the percentage of American adults who say they consider themselves vegetarian at 5%, and those who consider themselves vegans─who eat no meat or dairy products─at 2%. Do t

 相关资料
  • 本文向大家介绍clojure is,包括了clojure is的使用技巧和注意事项,需要的朋友参考一下 示例 该is宏是核心clojure.test库。它返回其主体表达式的值,如果该表达式返回假值,则输出错误消息。            

  • 描述 (Description) is( selector )方法根据表达式检查当前选择,如果选择的至少一个元素适合给定的选择器,则返回true。 如果没有元素适合,或者选择器无效,则响应将为“false”。 语法 (Syntax) 以下是使用此方法的简单语法 - <i>element</i>.is( selector ) 参数 (Parameters) 以下是此方法使用的所有参数的说明 - s

  • 预期:string 用于 动态组件,且基于 DOM 内模板的限制 来工作。 示例: <!-- component changes when currentView changes --> <component v-bind:is="currentView"></component> <!-- necessary because `<my-row>` would be invalid insid

  • is What 是一个非常简单且小巧的 JS 类型检查功能,它同样完全支持 TypeScript npm i is-what 用法 is-what 很容易使用,并且大多数功能都可以像你所期望的那样工作。 // import functions you want to use like so:import { isString, isDate, isPlainObject } from 'is-wh

  • NULL 值代表遗漏的未知数据。 默认地,表的列可以存放 NULL 值。 本章讲解 IS NULL 和 IS NOT NULL 操作符。 SQL NULL 值 如果表中的某个列是可选的,那么我们可以在不向该列添加值的情况下插入新记录或更新已有的记录。这意味着该字段将以 NULL 值保存。 NULL 值的处理方式与其他值不同。 NULL 用作未知的或不适用的值的占位符。 注释:无法比较 NULL 和

  • Masonry is a JavaScript grid layout library. It works by placing elements in optimal position based on available vertical space, sort of like a mason fitting stones in a wall. You’ve probably seen it