
Security News
Rust RFC Proposes a Security Tab on crates.io for RustSec Advisories
Rustâs crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.
count-promises
Advanced tools
This library helps you count the promises created from one point in time to
another. The intent is to help you find out where promises may be coming from
in order to optimize your application. Promises can be very expensive,
especially when async_hooks are used, so it's good to keep them to a minimum
if you can.
WARNING: This works on Node.js only.
This is a Node.js package on npm. Install it how you normally would install such a package.
Import it, call it to start counting, call the result to stop counting.
import startCounter from 'count-promises'
// At some point you want to start counting promises created...
const stop = startCounter()
// Now create a bunch of promises, maybe await them. Or not! For extra fun try
// awaiting non-promises and see how many promises that creates! :D
// At this point, we want to know how many promises have been created...
const total = stop()
console.log(total, 'promises have been created since `startCounter()`')
You can also pass an options object with the following two options:
locations: Instead of returning the total number of created promises,
return an object whose keys are callsites and whose values are numbers of
promises created at those callsites. Default false.continuation: Omit from the count any promises created outside the
async continuation starting at the startCounter() call. This is useful to
eliminate any noise from other current HTTP requests, for example. Default
false.The MIT License. See LICENSE.txt
FAQs
Count all the promises created between two execution points.
The npm package count-promises receives a total of 1 weekly downloads. As such, count-promises popularity was classified as not popular.
We found that count-promises 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
Rustâs crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.

Security News
/Research
Socket found a Rust typosquat (finch-rust) that loads sha-rust to steal credentials, using impersonation and an unpinned dependency to auto-deliver updates.

Research
/Security Fundamentals
A pair of typosquatted Go packages posing as Googleâs UUID library quietly turn helper functions into encrypted exfiltration channels to a paste site, putting developer and CI data at risk.