1.2.3 • Published 5 years ago
cocktail-api-facade v1.2.3
cocktail-api-facade
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
Requirements
- A version of Node.js high enough to support module syntax
Download & installation
npm install cocktail-api-facadeThen, import in your .js file:
import cocktailApi from 'cocktail-api-facade'#Usage
import cocktailApi from 'cocktail-api-facade'
cocktailApi.searchDrink('martini').then(drinks => doStuffWithDrinks())
cocktailApi.lookupIngredient('12').then(ingredient => doStuffWithIngredient())###Tests For an array of mocha-based tests, use:
npm install
npm run test