Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including uberclient with all npm packages installed. Try it out:

var uberclient = require("uberclient")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

uberclient v0.2.1

Thin client for UBER Hypermedia Format

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

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free