
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
superagent-promise-plugin
Advanced tools
Plugin for visionmedia/superagent. Use req.then or req['catch'] to execute your request and handle via promises.
Plugin for visionmedia/superagent
. Use req.then
or req['catch']
to execute your request and handle via promises.
npm install superagent superagent-promise-plugin --save
Requires ES6 Promises. Polyfill or set superagentPromisePlugin.Promise
with es6-promise
or equivalent.
var request = require('superagent');
var superagentPromisePlugin = require('superagent-promise-plugin');
superagentPromisePlugin.Promise = require('es6-promise');
request.get('/end/point')
.use(superagentPromisePlugin)
.then(function (res) {
// success
})
.catch(function (err) {
// error
var res = err.response; // the full response object
});
Patch the superagent
module so that every request has req.then
and req['catch']
methods.
require('es6-promise').polyfill();
var superagentPromisePlugin = require('superagent-promise-plugin');
var request = superagentPromisePlugin.patch(require('superagent'));
request.get('/end/point')
.then(function (res) {
// success
})
.catch(function (err) {
// error
});
FAQs
Plugin for visionmedia/superagent. Use req.then or req['catch'] to execute your request and handle via promises.
The npm package superagent-promise-plugin receives a total of 1,373 weekly downloads. As such, superagent-promise-plugin popularity was classified as popular.
We found that superagent-promise-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.