promise-request

0.1.2 • Public • Published

Promise based request

A Node.js promise wrapped http request micro library

This little lib offers a Promise wrapped http(s).request method.

Usage

var request = require('./promise-request');
 
var config = {
    scheme: 'https',
    host: 'api.twitter.com',
    path: '/1.1/statuses/mentions_timeline.json',
    method: 'GET'
};
 
request(config).then(function(result) {
    // do something on success...
}, function(error) {
    console.error(error);
});

Parameters:

  • options:
  • body: object to send as the request body. options.serialize will be applied on it.

Tests

You'll need mocha to run the tests. Once installed, simply run mocha in the project root directory.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    15
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    15

Package Sidebar

Install

npm i promise-request

Weekly Downloads

15

Version

0.1.2

License

MIT

Last publish

Collaborators

  • oliviernt