# cocktail-api-facade

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

Latest version **1.2.3** (published 2020-09-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install cocktail-api-facade
pnpm add cocktail-api-facade
yarn add cocktail-api-facade
bun add cocktail-api-facade
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.3 |
| Published | 2020-09-02 |
| First published | 2020-09-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 19.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | ileonichwiesz |

## Links

- npm: https://www.npmjs.com/package/cocktail-api-facade
- Repository: https://github.com/LeszekKicior/cocktail-api-facade
- Homepage: https://github.com/LeszekKicior/cocktail-api-facade#readme
- Issues: https://github.com/LeszekKicior/cocktail-api-facade/issues
- npm.io page: https://npm.io/package/cocktail-api-facade

## Dependencies (3)

- [babel](https://npm.io/package/babel.md) ^6.23.0
- [mocha](https://npm.io/package/mocha.md) ^8.1.3
- [isomorphic-unfetch](https://npm.io/package/isomorphic-unfetch.md) ^3.0.0

## Recent versions

- 1.2.3 (latest) — 2020-09-02
- 1.2.2 — 2020-09-02
- 1.2.1 — 2020-09-02
- 1.2.0 — 2020-09-01
- 1.1.0 — 2020-09-01
- 1.0.0 — 2020-09-01

## README

# 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:
```js
import cocktailApi from 'cocktail-api-facade'
```

#Usage

```js
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
```

---
_Source: https://npm.io/package/cocktail-api-facade · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
