
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
runforcover
Advanced tools
Runforcover is a require-hook library that uses node-bunker to provide code coverage data for your unit test library, whatever it might be.
var runforcover = require('runforcover');
Attach runforcover to the global require object and patch require.extensions['.js'] to
provide coverage metadata for all files required after this point. Returns a function
object that can be called to obtain a object keying files to CoverageData objects, with
a method for releasing control back to vanilla require. Usage:
var coverage = runforcover.cover(/.*/g);
require('some/library');
coverage(function(coverageData) {
// coverageData is an object keyed by filename.
var stats = coverageData['/full/path/to/file.js'].stats()
// the percentage of lines run versus total lines in file
console.log(stats.percentage);
// the number of missing lines
console.log(stats.missing);
// the number of lines run (seen)
console.log(stats.seen);
// an array of line objects representing 'missed' lines
stats.lines;
stats.lines.forEach(function(line) {
// the line number of the line:
console.log(line.number);
// returns a string containing the source data for the line:
console.log(line.source());
});
// return control back to the original require function
coverage.release();
});
new BSD.
FAQs
require plugin for js code coverage using bunker
The npm package runforcover receives a total of 43,524 weekly downloads. As such, runforcover popularity was classified as popular.
We found that runforcover 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.