coffeetrove
v1.0.0
Published
Coffee knowledge data and utilities from CoffeeTrove - origins, methods, beans, drinks, and scoring
Downloads
112
Maintainers
Readme
coffeetrove
Coffee knowledge data and utilities from CoffeeTrove.
Reference catalogs for coffee origins, brewing methods, bean varieties, and drinks. Includes Golden Drop scoring, brew ratio calculation, and caffeine estimation.
Installation
npm install coffeetroveUsage
const coffee = require("coffeetrove");
// Browse origins
coffee.ORIGINS.forEach(o => console.log(o.name, o.notes));
// Find a specific origin
const ethiopia = coffee.findOrigin("ethiopia");
// => { slug: "ethiopia", name: "Ethiopia", region: "Africa", notes: ["fruity", "floral", "wine-like"], altitude: "1500-2200m" }
// Filter origins by region
const african = coffee.originsByRegion("Africa");
// => [Ethiopia, Kenya, Rwanda]
// Brewing methods by difficulty
const beginner = coffee.methodsByDifficulty("beginner");
// => [French Press, AeroPress, Moka Pot, Cold Brew, ...]
// Brew ratio calculator
coffee.brewWater(18, "1:16"); // 288ml for pour over
coffee.brewWater(18, "1:2"); // 36ml for espresso
// Caffeine estimation
coffee.estimateCaffeine("espresso"); // 63mg
coffee.estimateCaffeine("latte", 2); // 126mg (double shot)
coffee.estimateCaffeine("cold-brew"); // 200mg
// Golden Drop scoring
const score = coffee.goldenDropScore({
name: "Blue Bottle Coffee",
rating: 4.6,
reviewCount: 350,
hasPhotos: true,
hasHours: true,
hasWebsite: true,
hasPhone: true,
chainType: "local",
});
// => 73
const tier = coffee.scoreTier(score);
// => { label: "Great", color: "#8BC34A" }
// Filter drinks
const hotDrinks = coffee.drinksByTemperature("hot");
const coldDrinks = coffee.drinksByTemperature("cold");Data Catalogs
Origins (15 countries)
Ethiopia, Colombia, Brazil, Kenya, Guatemala, Costa Rica, Indonesia, Vietnam, Jamaica, Yemen, Hawaii, Peru, Mexico, India, Rwanda.
Each origin includes: slug, name, region, tasting notes, and growing altitude.
Brewing Methods (15 methods)
Espresso, Pour Over, French Press, AeroPress, Moka Pot, Cold Brew, Turkish, Chemex, V60, Siphon, Drip, Percolator, Vietnamese Phin, Ibrik, Clever Dripper.
Each method includes: slug, name, grind size, brew time, ratio, and difficulty level.
Bean Varieties (10 types)
Arabica, Robusta, Liberica, Excelsa, Typica, Bourbon, Gesha, Catimor, SL28, Pacamara.
Each bean includes: slug, name, species, caffeine content, flavor profile, and market share.
Drinks (17 drinks)
Espresso, Americano, Latte, Cappuccino, Flat White, Macchiato, Mocha, Cortado, Ristretto, Lungo, Affogato, Cold Brew, Iced Latte, Frappe, Turkish, Irish, Vietnamese.
Each drink includes: slug, name, base method, milk presence, temperature, and country of origin.
API Reference
Data
ORIGINS- All coffee origins.METHODS- All brewing methods.BEANS- All bean varieties.DRINKS- All coffee drinks.SCORE_TIERS- Tier definitions for Golden Drop scores.
Scoring
goldenDropScore(cafe)- Calculate a score based on data completeness.scoreTier(score)- Get tier label and color for a score.
Calculators
brewWater(coffeeGrams, ratio?)- Calculate water amount from coffee weight and ratio.estimateCaffeine(drinkSlug, shots?)- Estimate caffeine content in milligrams.
Lookups
findOrigin(slug)- Find an origin by slug.findMethod(slug)- Find a brewing method by slug.findBean(slug)- Find a bean variety by slug.findDrink(slug)- Find a drink by slug.originsByRegion(region)- Filter origins by region.methodsByDifficulty(difficulty)- Filter methods by difficulty.drinksByTemperature(temp)- Filter drinks by temperature.
TypeScript
Type definitions are included.
import { findOrigin, Origin, Method } from "coffeetrove";Links
License
MIT. See LICENSE for details.
