Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aaronpowell/boozey.js
A wrapper for the Open Beer Database API
https://github.com/aaronpowell/boozey.js
Last synced: about 1 month ago
JSON representation
A wrapper for the Open Beer Database API
- Host: GitHub
- URL: https://github.com/aaronpowell/boozey.js
- Owner: aaronpowell
- License: mit
- Created: 2012-12-12T07:19:08.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2012-12-12T11:24:54.000Z (about 12 years ago)
- Last Synced: 2024-11-28T21:02:41.062Z (about 1 month ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Boozey
[![Build Status](https://travis-ci.org/aaronpowell/boozey.js.png?branch=master)](https://travis-ci.org/aaronpowell/boozey.js)
Boozey is a library (and cli tool) for querying the [Open Beer Database](http://openbeerdatabase.com) API v1.
# Usage
You can use this in either node.js as a library or from the cli.
## Node.js
Get it from npm:
npm install boozey
Use it as a package:
var boozey = require('boozey');
boozey.beer.all().pipe(process.stdout);
You can pass in any of the arguments as defined on the [website](http://openbeerdatabase.com/documentation/beers-get):
boozey.beer.all({
query: 'ale',
order: 'id',
dir: 'ASC',
page: 1,
perPage: 10,
token: ''
}).pipe(process.stdout);To get back a single beer use the `get` method:
boozey.beer.get(3).pipe(process.stdout);
If you want to query against breweries not beers then just change `beer` to `brewery`:
boozey.brewery.get(3);
## cli
Install it as a global npm package:
npm install -g boozey
Usage: boozey [options] [command]
Commands:
beer Perform operations for beer
brewery Perform options for a breweryOptions:
-h, --help output usage information
-V, --version output the version number
-t, --token API token
-p, --pretty Pretty print the result
--page [page] Page number to get
-pp, --per-page [perPage] Records per page
--order-by [order] Field to order by
-d, --direction [dir] Sort order direction, ASC or DESC
-q, --query [query] Query to use to filter the data set
-i, --id Id of the specific beer to getFor example (pretty prints the first 5 beers):
boozey beer -p -pp 5
# License
MIT
# Author
Aaron Powell