1.2.3 • Published 4 years ago

cocktail-api-facade v1.2.3

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

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 string
  • lookupDrink(id) - returns a promise that resolves to details of a specific drink
  • searchIngredient(string) - returns a promise that resolves to an array of ingredients that match given string
  • lookupIngredient(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-facade

Then, 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
1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago