
Research
/Security News
737 Chrome VPN Extensions Linked to Brand Impersonation and Browser Traffic Redirection
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.
memcheck-node
Advanced tools
Automated memory leak regression testing for Node.js — detect growing object graphs in CI
Automated memory leak regression testing for Node.js — detect growing object graphs in CI
npm install memcheck-node
import memcheck, {assertNoLeaks, formatReport} from 'memcheck-node';
// Check a scenario for memory leaks
const result = await memcheck(async () => {
// Your scenario: e.g., handle an HTTP request
const data = processRequest({id: 1});
return data;
}, {
iterations: 5,
allowedGrowth: 0.1, // Allow up to 10% heap growth
});
console.log(result.leaked);
// => false
console.log(formatReport(result));
// Or use assertNoLeaks in your tests
await assertNoLeaks(async () => {
// This will throw if a leak is detected
processRequest({id: 1});
});
memcheck(scenario, options?)Returns: Promise<{leaked, snapshots, growth}>
Run a scenario function multiple times and detect memory leaks by monitoring heap growth.
Type: () => Promise<void> | void
A function that performs the operation to test.
Type: number
Default: 5
Number of snapshot cycles to run.
Type: boolean
Default: true
Force garbage collection between iterations. Requires --expose-gc flag or global.gc to be available.
Type: number
Default: 0.1
Maximum allowed heap growth as a decimal (0.1 = 10%).
leaked — true if a memory leak was detectedsnapshots — Array of {usedHeapSize, totalHeapSize, iteration} objectsgrowth — Percentage growth as a decimalformatReport(result)Returns: string
Format a memcheck result as a human-readable report.
assertNoLeaks(scenario, options?)Returns: Promise<MemcheckResult>
Run memcheck and throw an error if a memory leak is detected. Useful in test suites.
MIT
FAQs
Automated memory leak regression testing for Node.js — detect growing object graphs in CI
The npm package memcheck-node receives a total of 1 weekly downloads. As such, memcheck-node popularity was classified as not popular.
We found that memcheck-node demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.