Registry / testing / one-double-zero

one-double-zero

JSON →
library1.1.1jsnpmunverified

One Double Zero is a code coverage tool focusing on relevance, accuracy, simplicity, flexibility, and speed. It offers a CLI tool named 'odz' that wraps any command to collect V8-based coverage data. As of version 1.1.1, it is actively maintained with frequent releases. Unlike other coverage tools like Istanbul or c8, One Double Zero aims for minimal configuration and high precision by leveraging native V8 coverage. It ships TypeScript types and supports both ESM and CommonJS.

npm install one-double-zero
INSTALL
IMPORT
SIG · ONE-DOUBLE-ZERO
O
one-double-zero
testingjavascriptv1.1.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default export
import odz from 'one-double-zero'
const odz = require('one-double-zero')
The package is ESM-only since v1. Use import syntax. No CommonJS require.
TypeScript types
import type { CoverageResult } from 'one-double-zero'
import { CoverageResult } from 'one-double-zero'
Types are exported but using value import will cause runtime error. Use 'import type' for TypeScript.
programmatic API
import { runCoverage } from 'one-double-zero'
const { runCoverage } = require('one-double-zero')
Named exports from ESM only. No default export for programmatic API.

Demonstrates CLI usage and programmatic API to collect V8 coverage data with include/exclude patterns.

// Install globally npm i -g one-double-zero // Run a command with coverage odz node my-test.js // Programmatic usage import { runCoverage } from 'one-double-zero'; const result = await runCoverage({ command: 'node', args: ['my-test.js'], include: ['src/**/*.js'], exclude: ['node_modules'] }); console.log(result.lines); // e.g., { covered: 80, total: 100 }
odz --version
Debug
Known issues
breakingv1.0.0 changed from CJS to ESM-only. require() will throw ERR_REQUIRE_ESM.
fix
Use import syntax or dynamic import().
affects: >=1.0.0
gotchaWhen using programmatic API, the 'include' pattern must be absolute or relative to process.cwd(). Relative paths without leading './' may not match.
fix
Use absolute paths or prefix relative paths with './'.
affects: all
deprecatedThe .odzrc config file format changed in v1.1.0. Old 'exclude' key renamed to 'coverageExclude'.
fix
Update config to use 'coverageExclude' instead of 'exclude'.
affects: >=1.1.0 <1.1.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using CommonJS require() to load the ESM-only package.
fix
Change to import statement or use dynamic import().
TypeError: Cannot destructure property 'runCoverage' of 'undefined' or 'null'
Using destructuring from default import instead of named import.
fix
Use import { runCoverage } from 'one-double-zero' instead of import odz from 'one-double-zero' then destructure.
Error: ENOENT: no such file or directory, open 'coverage.json'
The output file path does not exist or the process lacks write permissions.
fix
Ensure the output directory exists or use an absolute path with existing directory.
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
one-double-zero — npm install one-double-zero · libregistry