node-heroku-api
Port of heroku-api gem to NodeJS.
Installation
$ npm install heroku-legacy
Usage
The API is exactly the same, with the following differences:
- All the methods take a callback of the following form:
function (err, body)
whereerr
is one of the error defined insrc/errors.coffee
if any, ornull
otherwise andbody
is the JSON response. - All the methods are camelCased.
- When using the
username/password
constructor, the object should be used in the callback, and not as the return value.
Here is a short example (in CoffeeScript).
With username/password:
HerokuApi = require 'heroku-legacy' username: 'test@foo.jp'password: 'password' return handleErrorerr unless err == null apigetApps return handleError unless err == null consolelog apps
With API key:
HerokuApi = require 'heroku-legacy'api = apiKey: 'my-api-key'apigetApps return handleErrorerr unless err == null consolelog apps