
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
promise-timer
Advanced tools
Provides timing of promises.
These have similar definitions to bluebird's promisify:
npm install promise-timer
var Promise = require('bluebird');
require('promise-timer')(Promise);
var superagent = require('superagent');
var agent = require('superagent-promise')(superagent, Promise);
var API = {
getUsersAsync: function() {
return agent.get('/users/').end();
},
getDriversAsync: function() {
return agent.get('/drivers/').end();
},
getDriverAsync: function(driverId) {
return agent.get('/drivers/' + driverId).end();
}
};
Promise.timeifyAll(API, function(fnName, timeData) {
console.log(timeData, "Called " + fnName);
/*
e.g. timeData =
{
start: 1453746070761,
end: 1453746070914,
elapsed: 153,
called: "getDriverAsync(100)"
}
*/
}, /* optional */ {
suffix: 'Timed', // or leave empty to override methods,
filter: function(name, func, target, passesDefaultFilter) { // optional filter
return _.includes(['getUsersAsync', 'getDriversAsync'], name);
}
});
Or for single functions:
var getDriversAsyncTimed = Promise.timeify(API.getDriversAsync, function(fnName, timeData) {
console.log(timeData, "Called " + fnName);
}, API);
FAQs
Provides timing of promises.
The npm package promise-timer receives a total of 0 weekly downloads. As such, promise-timer popularity was classified as not popular.
We found that promise-timer 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.