uberclient

0.2.1 • Public • Published

uber.client.js

Build Status   Coverage Status   Code Climate   NPM Version  

Javascript/Node.js Client for UBER hypermedia format.

Design Goals

Minimal, robust, extensible

Example 1:

var client = require('uberclient')
  , token  = '1234567890'; // You'd normally get this from a separate OAuth2 workflow
 
client.authProvider(client.authProviderTokenBased({'token' : token}));
 
client.request('http://api.froyo.io', function (error, msg) {
  if (!error) {
    var names = msg.query({"rel" : "urn:froyo_io:query:names"}).submit({"m" : "male"});
  }
}, "read", "xml");

Example 2:

 var url = 'https://raw.githubusercontent.com/inadarei/uber.client.js/master/test/fixtures/uber-sample.json';
    client.request(url, function(error, uberMsg) {
      if (!err) {
        var appendPerson = uberMsg.query({"id" : "people"})
                          .query({"rel" : "http://example.org/rels/create"})
                          .submit({"g" : "irakli",
                                   "f" : "nadareishvili",
                                   "e" : "irakli@example.com"});
                                   // Warning: .submit() implementation is in progress.
      }
    });

Full Documentation

You can see full documentation of the client at: http://jsclient.uberhypermedia.org

/uberclient/

    Package Sidebar

    Install

    npm i uberclient

    Weekly Downloads

    0

    Version

    0.2.1

    License

    MIT

    Last publish

    Collaborators

    • irakli