Skip to content

hypergroup/hyperagent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hyperagent

hyper+json client for node.js and the browser.

Installation

Node

$ npm install hyperagent

Component

$ component install hypergroup/hyperagent

Usage

Call the hyperagent function, passing the root url of the hyper+json API.

var hyperagent = require('hyperagent');

var client = hyperagent('http://api.example.com');

Use the client to traverse any paths

client('.users.0.name', function(err, name) {
  console.log('Hello, ' + name);
});

client('.users.0.friends.0.friends.0.name', function(err, name) {
  console.log('Hello friend of a friend, ' + name);
});
client.submit('.users.0.update', {name: 'Mike'}, function(err, body, res) {
  console.log(res);
});

About

Hyper client with superagent interface

Resources

Stars

Watchers

Forks

Packages

No packages published