promised-request

1.0.0 • Public • Published

A wrapper for Mikeals request module, that returns a promise

Usually you can use promised-io.promise.convertNodeAsyncFunction to convert any function to a promise returning function. But convertNodeAsyncFunction is smart and figures out that request returns two success values - response and body - and therefore emits an array. since you can get to the body argument of request also by response.body, that is the only success value you need. and that is what this wrapper method does.

Usage:

var request = require( 'promised-request' );
request( 'http://sifu.io' ).then( function( response ) { console.info( resonse.body ) } );

Readme

Keywords

none

Package Sidebar

Install

npm i promised-request

Weekly Downloads

88

Version

1.0.0

License

none

Last publish

Collaborators

  • sifu