npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

a3-cocktail-recipes

v1.4.1

Published

Library to get recipes of every cocktail using the [Cocktail API](https://www.thecocktaildb.com/api.php)

Downloads

1

Readme

Cocktail recipes

Library to get recipes of every cocktail using the Cocktail API

Installation

npm i a3-cocktail-recipes

Local development

npm install
npm run test

Usage

When you install the library you will have access to multiple function

Search cocktail by name

Retrieve all the informations about a cocktail with his name :

  • Id
  • Name
  • Tags
  • Category
  • IBA
  • Glass
  • Instructions
  • Image Thumb
  • Ingredients
  • Measures
import {searchCocktailByName} from 'a3-cocktail-recipes'

const cocktail = await searchCocktailByName('margarita')

return an object

Search coktails by first letter

Retrieve all cocktails starting with the given letter

import {searchCocktailByFirstLetter} from 'a3-cocktail-recipes'

const cocktails = await searchCocktailByFirstLetter('2')

return an array of cocktails

Search ingredient by name

Retrieve all the informations about an ingredient with his name :

  • Id
  • Name
  • Description
  • Type
  • Alcohol ?
  • Degree
import {searchIngredientByName} from 'a3-cocktail-recipes'

const ingredient = await searchIngredientByName('Gin')

return an object

Get all cocktails by alcoholic type

Retrieve all cocktails of a given alcoholic type

Types (needs to be written exactly like this):

  • Alcoholic
  • Non alcoholic
  • Optional alcohol
import {filterCocktailsByAlcoholicType} from 'a3-cocktail-recipes'

const cocktails = await filterCocktailsByAlcoholicType('Alcoholic')

return an array of cocktails

Get all cocktails by category

Retrieve all cocktails of a given category

Categories (needs to be written exactly like this):

  • Ordinary Drink
  • Cocktail
  • Shake
  • Other / Unknown
  • Cocoa
  • Shot
  • Coffee / Tea
  • Homemade Liqueur
  • Punch / Party Drink
  • Beer
  • Soft Drink
import {filterCocktailsByCategory} from 'a3-cocktail-recipes'

const cocktails = await filterCocktailsByCategory('Ordinary Drink')

return an array of cocktails

Get all cocktails by glass type

Retrieve all cocktails used with a given glass type

Glass types (needs to be written exactly like this):

  • Highball glass
  • Cocktail glass
  • Old-fashioned glass
  • Whiskey Glass
  • Collins glass
  • Pousse cafe glass
  • Champagne flute
  • Whiskey sour glass
  • Cordial glass
  • Brandy snifter
  • White wine glass
  • Nick and Nora Glass
  • Hurricane glass
  • Coffee mug
  • Shot glass
  • Jar
  • Irish coffee cup
  • Punch bowl
  • Pitcher
  • Pint glass
  • Copper Mug
  • Wine Glass
  • Beer mug
  • Margarita/Coupette glass
  • Beer pilsner
  • Beer Glass
  • Parfait glass
  • Mason jar
  • Margarita glass
  • Martini Glass
  • Balloon Glass
  • Coupe Glass
import {filterCocktailsByGlassType} from 'a3-cocktail-recipes'

const cocktails = await filterCocktailsByGlassType('Highball')

return an array of cocktails

Look up coktails by ID

Retrieve all cocktail's info with the given ID

import {lookupCocktailById} from 'a3-cocktail-recipes'

const cocktail = await lookupCocktailById('11007')

return an object cocktail

Look up ingredients by ID

Retrieve all ingredient's info with the given ID

import {lookupIngredientById} from 'a3-cocktail-recipes'

const cocktail = await lookupIngredientById('1')

return an object ingredient

Look up a random cocktail

Retrieve a random cocktail

import {lookupRandomCocktail} from 'a3-cocktail-recipes'

const cocktail = await lookupRandomCocktail()

return an object cocktail

List all cocktail, glass, ingredients or alcohol types

Retrieve a list of cocktail, glass, ingredients or alcohol types

import {listCocktailTypes, listGlassTypes, listIngredients, listAlcoholTypes} from 'a3-cocktail-recipes'

const cocktailTypes = await listCocktailTypes()
const glassTypes = await listGlassTypes()
const ingredients = await listIngredients()
const alcoholTypes = await listAlcoholTypes()

return an array of types