
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.
Measure the time a promise takes to resolve
npm install p-time
import pTime from 'p-time';
import {execa} from 'execa';
const promise = pTime(execa)('sleep', ['1']);
await promise;
console.log(promise.time);
//=> 1016
Returns a decorated version of asyncFunction
that when called returns a Promise
with a time
property of the elapsed time in milliseconds.
Returns a decorated version of asyncFunction
that when called logs the elapsed time in milliseconds of the Promise
.
Type: Function
Promise-returning/async function.
FAQs
Measure the time a promise takes to resolve
The npm package p-time receives a total of 1,356 weekly downloads. As such, p-time popularity was classified as popular.
We found that p-time 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.