GithubHelp home page GithubHelp logo

brewerydb-node's Introduction

brewerydb-node

##Status## Only very recently published: should be considered alpha!
This is somewhat tested, and somewhat finished. It does not completely wrap BreweryDB’s REST api (notably all POST/edit actions on the db are unimplemented), but it does what I need it to do right now - get data from the db. I based my interface off the one Tyler Hunt made his wrapper written in Ruby.

##Installation## You should install this library with npm:

npm install brewerydb-node

##Documentation## ###How to use### var BreweryDb = require('brewerydb-node'); var brewdb = new BreweryDb('your-key-here');

Callbacks should should take two arguments, err, and data, as per convention

###Endpoints### ####Beer#### beer.getById(id/Array of ids, params (see options in BreweryDb Api docs), callback)

// /beer/:beerId
brewdb.beer.getById("avMkil", {}, callback);      

// /beers?ids=
brewdb.beer.getById(["avMkil", "XcvLTe"], { withBreweries: "Y" }, callback);     

// /beers?name=“bock”&abv=....
// can provide params that beers endpoint accepts (like abv, ibu, etc.)
brewdb.beer.find({ name:"bock" }, callback)

####Brewery#### brewdb.breweries.getById("g0jHqt", {}, callback); brewdb.breweries.getById(["g0jHqt", {}, "MWi5Kp"], callback) brewdb.breweries.find( { established: 2010 }, callback)

####Search#### brewdb.search.all( { q: "coors" }, callback); brewdb.search.beers({ q: "dogfish" }, callback); brewdb.search.breweries({ q: "dogfish" }, callback);

####Category#### brewdb.category.all(callback); brewdb.category.getById(1, callback);

####Style#### brewdb.style.all(callback); brewdb.style.getById(1,callback)

##Todo##

  1. Write better tests?
  2. Implement glassware
  3. Write better docs

brewerydb-node's People

Contributors

ronandi avatar securingsincity avatar

Watchers

James Cloos avatar mkolh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.