node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป



Build Status

nodejs-api-client is a generic API client that can work with almost every web API. It also contains a more specific client to use with API.

How to install

npm install --save nodejs-api-client

How to use

in CoffeeScript

Client = require('nodejs-api-client')
options =
    host: '...' #default ''
    port: ... #default 80
    apiKey: '...'
    secretKey: '...'
client = new Client options

client.path method, path, (err, res, body) ->
    #do whatever with the data

#More complexe but still quite simple..
options =
        q: 'nice query'
#for more options

client.path method, path, options, (err, res, body) ->
    #do whatever with the data


Add some shortcuts to the Client like client.users(userId, callback) for all the routes of the API.