superagent-promise
Plugin for visionmedia/superagent
. Use req.then
or req['catch']
to execute your request and handle via promises.
Install
npm install superagent superagent-promise-plugin --save
How to use
Requires ES6 Promises. Polyfill or set superagentPromisePlugin.Promise
with es6-promise
or equivalent.
var request = ;var superagentPromisePlugin = ; superagentPromisePluginPromise = ; request ;
Patching superagent
Patch the superagent
module so that every request has req.then
and req['catch']
methods.
;var superagentPromisePlugin = ;var request = superagentPromisePlugin; request ;