New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

cocktail-api-facade

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cocktail-api-facade

A JS facade for https://www.thecocktaildb.com API

latest
Source
npmnpm
Version
1.2.3
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 02 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts