Skip to content

vvnab/restler-q

This branch is 10 commits ahead of troupe/restler-q:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9f8aa6c · Jul 29, 2019

History

36 Commits
Jul 29, 2019
Dec 4, 2014
Oct 31, 2013
Feb 22, 2015
Oct 31, 2013
Oct 31, 2013
Dec 4, 2014
Oct 31, 2013
Sep 20, 2018

Repository files navigation

restler-q Build Status

(C) Andrew Newdigate (@suprememoocow), Licensed under the MIT-LICENSE

An extremely simple Q promises wrapper for Don Wrong's Restler library.

Installing

npm install restler-q

Using

The interface is similar to Restler's interface:

var rest = require('restler-q');

rest.get('https://api.github.com/orgs/Troupe/repos')
  .then(function(repos) {
    assert(Array.isArray(repos));
  })
  .nodeify(done);

If you would like to gain access to the response object, do it like this

var rest = require('restler-q').spread; // Note the .spread on the end!
rest.get('https://api.github.com/orgs/Troupe/repos')
  .spread(function(repos, response) {
    // Use Q's `spread`, not `then` 
    assert(Array.isArray(repos));
  })
  .fail(function(err) {
    // err.response contains the HTTP Response
  })
  .nodeify(done);

Running the tests

npm install
make test

TODO

  • Provide ability to call abort and retry methods.

About

Q promises wrapper for Restler

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 97.5%
  • Makefile 2.5%