nodejs-api-client

0.3.1 • Public • Published

nodejs-api-client

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 Openify.it API.

How to install

npm install --save nodejs-api-client

How to use

in CoffeeScript

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

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

#More complexe but still quite simple..
options =
    qs:
        q: 'nice query'
#for more options
#https://github.com/mikeal/request#requestoptions-callback
#http://documentation.openify.it

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

TODOS

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

Readme

Keywords

none

Package Sidebar

Install

npm i nodejs-api-client

Weekly Downloads

1

Version

0.3.1

License

none

Last publish

Collaborators

  • jackdbernier