A simple JS facade for https://www.thecocktaildb.com API.
Features 4 separate functions for displaying API data:
searchDrink(string)
- returns a promise that resolves to an array of drinks that match given stringlookupDrink(id)
- returns a promise that resolves to details of a specific drinksearchIngredient(string)
- returns a promise that resolves to an array of ingredients that match given stringlookupIngredient(id)
- returns a promise that resolves to details of a specific cocktail ingredient
- A version of Node.js high enough to support module syntax
npm install cocktail-api-facade
Then, import in your .js
file:
import cocktailApi from 'cocktail-api-facade'
import cocktailApi from 'cocktail-api-facade'
cocktailApi.searchDrink('martini').then(drinks => doStuffWithDrinks())
cocktailApi.lookupIngredient('12').then(ingredient => doStuffWithIngredient())
For an array of mocha-based tests, use:
npm install
npm run test