![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Simple, effective JavaScript benchmarking.
npm install birdpoo
Birdpoo (or BP so we can stop chuckling like 5-year olds), is just a single function that returns a promise with the operations per second. It accepts two arguments:
before
- Called before each execution to do any necessary setup and pass information to the benchmark function that it needs to run. The return value is used as the arguments passed to the bencmark function and, if passing arguments, it should be an array
.after
- Called after each execution to do any necessary cleanup.time
- The number of milliseconds to benchmark for.function before(next) {
// `this` refers to the passed in options so this persists throughout the
// benchmark's lifeyccle.
this.data = { some: 'data' };
// You call next to proceed to the benchmark() function. This can be async.
next();
}
function benchmark(next) {
// The options are accessible in any function. Logs: `{ some: 'data' }`.
console.log(this.data);
// You call next to proceed to the after() function. This can be async.
next();
}
function after(next) {
// The options are accessible in any function. Logs: `{ some: 'data' }`.
console.log(this.data);
// You call next to proceed to signify completion and to star the next cycle.
next();
}
const time = 1000;
benchmark(benchmark, { after, before, time }).then(console.log);
The benchmark will probably run over the amount of time specified in the options
due to the execution time of before
and after
, but only the time taken for the benchmark function to run will factor into the result.
That's pretty much it.
FAQs
Simple, effective JavaScript benchmarking.
The npm package birdpoo receives a total of 0 weekly downloads. As such, birdpoo popularity was classified as not popular.
We found that birdpoo 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.