{"id":18627,"library":"one-double-zero","title":"One Double Zero","description":"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.","status":"active","version":"1.1.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","coverage","istanbul","tdd","test","testing","v8","typescript"],"install":[{"cmd":"npm install one-double-zero","lang":"bash","label":"npm"},{"cmd":"yarn add one-double-zero","lang":"bash","label":"yarn"},{"cmd":"pnpm add one-double-zero","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is ESM-only since v1. Use import syntax. No CommonJS require.","wrong":"const odz = require('one-double-zero')","symbol":"default export","correct":"import odz from 'one-double-zero'"},{"note":"Types are exported but using value import will cause runtime error. Use 'import type' for TypeScript.","wrong":"import { CoverageResult } from 'one-double-zero'","symbol":"TypeScript types","correct":"import type { CoverageResult } from 'one-double-zero'"},{"note":"Named exports from ESM only. No default export for programmatic API.","wrong":"const { runCoverage } = require('one-double-zero')","symbol":"programmatic API","correct":"import { runCoverage } from 'one-double-zero'"}],"quickstart":{"code":"// Install globally\nnpm i -g one-double-zero\n\n// Run a command with coverage\nodz node my-test.js\n\n// Programmatic usage\nimport { runCoverage } from 'one-double-zero';\n\nconst result = await runCoverage({\n  command: 'node',\n  args: ['my-test.js'],\n  include: ['src/**/*.js'],\n  exclude: ['node_modules']\n});\n\nconsole.log(result.lines); // e.g., { covered: 80, total: 100 }","lang":"typescript","description":"Demonstrates CLI usage and programmatic API to collect V8 coverage data with include/exclude patterns."},"warnings":[{"fix":"Use import syntax or dynamic import().","message":"v1.0.0 changed from CJS to ESM-only. require() will throw ERR_REQUIRE_ESM.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use absolute paths or prefix relative paths with './'.","message":"When using programmatic API, the 'include' pattern must be absolute or relative to process.cwd(). Relative paths without leading './' may not match.","severity":"gotcha","affected_versions":"all"},{"fix":"Update config to use 'coverageExclude' instead of 'exclude'.","message":"The .odzrc config file format changed in v1.1.0. Old 'exclude' key renamed to 'coverageExclude'.","severity":"deprecated","affected_versions":">=1.1.0 <1.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Change to import statement or use dynamic import().","cause":"Using CommonJS require() to load the ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported"},{"fix":"Use import { runCoverage } from 'one-double-zero' instead of import odz from 'one-double-zero' then destructure.","cause":"Using destructuring from default import instead of named import.","error":"TypeError: Cannot destructure property 'runCoverage' of 'undefined' or 'null'"},{"fix":"Ensure the output directory exists or use an absolute path with existing directory.","cause":"The output file path does not exist or the process lacks write permissions.","error":"Error: ENOENT: no such file or directory, open 'coverage.json'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}