Skip to content

LeszekKicior/cocktail-api-facade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published