Registry / testing / one-double-zero-core

one-double-zero-core

JSON →
library1.0.2jsnpmunverified

A code coverage API for JavaScript aiming at relevance, accuracy, simplicity, flexibility and speed (v1.0.2). It leverages V8's built-in coverage for fast, accurate results without instrumenting code. The API is designed to be minimal and composable, catering to both programmatic use and integration with test runners. Ships TypeScript types. Released under ISC license. Known for being lighter and faster than c8 or Istanbul, but with a different API paradigm.

npm install one-double-zero-core
INSTALL
IMPORT
SIG · ONE-DOUBLE-ZERO-CO
O
one-double-zero-core
testingjavascriptv1.0.2
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

default
✓ import oneDoubleZeroCore from 'one-double-zero-core'
✗ import { oneDoubleZeroCore } from 'one-double-zero-core'
Module provides a default export, not named exports.
Coverage
✓ import { Coverage } from 'one-double-zero-core'
✗ import Coverage from 'one-double-zero-core'
Coverage is a named export; do not use default import for it.
Instrumenter
✓ import { Instrumenter } from 'one-double-zero-core'
✗ import Instrumenter from 'one-double-zero-core'
Instrumenter is a named export.
commonjs require
✓ const oneDoubleZeroCore = require('one-double-zero-core')
✗ const { oneDoubleZeroCore } = require('one-double-zero-core')
CJS users must require the default export; destructing works but only for named exports which are also available.

Shows basic usage: initialize coverage with include/exclude patterns, then take snapshot after tests.

import coverage from 'one-double-zero-core'; const { Coverage } = await coverage.load({ // Paths to cover, e.g., 'src/**/*.js' include: ['src/**/*.js'], // Exclude patterns exclude: ['node_modules'] }); // After your tests run, gather coverage data const result = await Coverage.takeSnapshot(); console.log('Coverage percentage:', result.summary.coveredLines / result.summary.totalLines * 100);
Debug
Known issues
breakingAPI differs from c8/istanbul; no automatic instrumenter.
fix
Use explicit Coverage and Instrumenter classes; refer to docs for programmatic usage.
affects: >=1.0.0
gotchaMust call coverage.load() before tests; otherwise snapshot returns empty.
fix
Always await coverage.load() at the start of your test setup.
affects: >=1.0.0
gotchaExcludes 'node_modules' by default; override if needed.
fix
Set exclude: [] to include node_modules (not recommended).
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: (0 , _oneDoubleZeroCore.default) is not a function
Using default import incorrectly in TypeScript or Babel when module is CJS?
fix
Ensure you use import coverage from 'one-double-zero-core' with ESM and appropriate tsconfig (esModuleInterop: true).
Error: ENOENT: no such file or directory, open 'path/to/coverage.json'
Forgetting to provide output path or calling snapshot before load.
fix
Check that coverage.load() was awaited and options are correct.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

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