{"name":"coverage-node","version":"2.0.0","description":"A simple CLI to run Node.js and report code coverage.","license":"MIT","author":{"name":"Jayden Seric","email":"me@jaydenseric.com","url":"https://jaydenseric.com"},"repository":{"type":"git","url":"git+https://github.com/jaydenseric/coverage-node.git"},"homepage":"https://github.com/jaydenseric/coverage-node#readme","bugs":{"url":"https://github.com/jaydenseric/coverage-node/issues"},"funding":"https://github.com/sponsors/jaydenseric","keywords":["node","v8","check","report","code","coverage"],"main":"lib","bin":{"coverage-node":"cli/coverage-node.js"},"engines":{"node":">=10"},"dependencies":{"@bcoe/v8-coverage":"^0.2.3","kleur":"^3.0.3"},"devDependencies":{"eslint":"^6.7.2","eslint-config-env":"^12.0.1","eslint-config-prettier":"^6.7.0","eslint-plugin-import":"^2.19.1","eslint-plugin-jsdoc":"^18.4.3","eslint-plugin-node":"^10.0.0","eslint-plugin-prettier":"^3.1.2","jsdoc-md":"^4.0.1","prettier":"^1.19.1","test-director":"^2.0.0"},"scripts":{"prepare":"npm run prepare:jsdoc && npm run prepare:prettier","prepare:jsdoc":"jsdoc-md","prepare:prettier":"prettier readme.md --write","test":"npm run test:eslint && npm run test:prettier && npm run test:api","test:eslint":"eslint .","test:prettier":"prettier '**/*.{json,yml,md}' -l","test:api":"node cli/coverage-node test","prepublishOnly":"npm test"},"gitHead":"2a0a79b3d684632ac60404a717e072ae9cbabb70","_id":"coverage-node@2.0.0","_nodeVersion":"13.5.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-3JrfGq6nrYbsXPMf7L23ac2z9bkh7vleJq2LTd0ZEgSHMvHayY746s2dMIzkv3oIBNkvc1fYUXepzDWIPejQSQ==","shasum":"1782a61f9e73621d36cb31009b48acfc42a3bc9b","tarball":"http://registry-npm.ywwl.com/coverage-node/download/coverage-node-2.0.0.tgz","fileCount":17,"unpackedSize":26092,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd/vaXCRA9TVsSAnZWagAABXAP+wfrHWzSFELf06z3oPIj\neLEwhtM7zv1hc7xrsPRWQ1vufeUf6oerOhqmFnd5DkaDXIwfXoKorHBHjfdK\nsX1Ob6KiE3/ZiyYsdBfenc+aLA5gH5f4vDqdBe/pnaYiXPw6rHf/CjPF1hrp\nMv126LrNLrb0s1fWYCBtlLJvenhvoMwYARNZmcdNyFybAgMoA1cBRU4I+f3p\nhQIP16BBAHJXwLRh9Trnpjtxvzl0Ym9vDDYH7M3cFO+wXPu6xpCcwdd3ivwc\nL8d6cmnWkDVWyYR4bGXTw4b8iVgCz+6eG0pUqvhX1YFHnUHjlrZ+RtKJEgnW\nalgXw7LgYVDEcHDDZ6v1ei2v7OhGuArGbbyuU12i2kpgFPjcifdjVSabHLFi\no+61IXCF8bbMrm+ce49gohcq/RncS6v1WG33w/2Rg1pymxWO5ww7Ynys5qOc\nPQizPraP+m+gPswWiZ/6pM8T9PAMYk0Rmu61t1/lgGU9ft9EmLnGSWRKXNj4\nTgTswS/j6/R7k8+/MjjjpBVbtORNqVUGa3uV2vUg7O9Ssp3hEm4IISTO9lu4\neAEezDztMWY1eQOP9ExBFGR8smPumLpYmuBP3SSt8EetukVTBeb3Bq6Zi4qC\nkeVEOG4Vz5NWTra1+fp1uBzpZQsp3U2FOOAekYk0qe/2XSxbUZwnDahnKqX2\n7nbH\r\n=DT3l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzsJBurgG1lKw6HPjmL1DZJdaJYTgXIAfX9niFhNwZIgIhAP/2oM9e6+5yt+rMsrFd2HvTrGU18PHzqEWgBRBDYjRM"}],"size":7907,"noattachment":false,"key":"/coverage-node/-/coverage-node-2.0.0.tgz"},"maintainers":[{"name":"jaydenseric","email":"me@jaydenseric.com"}],"_npmUser":{"name":"jaydenseric","email":"me@jaydenseric.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coverage-node_2.0.0_1576990359357_0.09678241266636323"},"_hasShrinkwrap":false,"readme":"# coverage-node\n\nA simple CLI to run [Node.js](https://nodejs.org) and report code coverage.\n\n- ✨ Zero config.\n- 🏁 Tiny source, written from scratch to use [code coverage features](https://nodejs.org/api/cli.html#cli_node_v8_coverage_dir) built into Node.js.\n- 📦 [Lean install size](https://packagephobia.com/result?p=coverage-node), compared to [1.94 MB for `c8` v7.11.1](https://packagephobia.com/result?p=c8@7.11.1) or [8.84 MB for `nyc` v15.1.0](https://packagephobia.com/result?p=nyc@15.1.0).\n- 🖱 Displays ignored or uncovered source code ranges as paths, clickable in IDEs such as [VS Code](https://code.visualstudio.com).\n\n## Installation\n\nTo install [`coverage-node`](https://npm.im/coverage-node) with [npm](https://npmjs.com/get-npm), run:\n\n```sh\nnpm install coverage-node --save-dev\n```\n\nIn a [`package.json` script](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#scripts), replace the `node` command with [`coverage-node`](#command-coverage-node):\n\n```diff\n {\n   \"scripts\": {\n-    \"test\": \"node test.mjs\"\n+    \"test\": \"coverage-node test.mjs\"\n   }\n }\n```\n\n## Requirements\n\nSupported operating systems:\n\n- Linux\n- macOS\n\nSupported runtime environments:\n\n- [Node.js](https://nodejs.org) versions `^14.17.0 || ^16.0.0 || >= 18.0.0`.\n\nProjects must configure [TypeScript](https://typescriptlang.org) to use types from the ECMAScript modules that have a `// @ts-check` comment:\n\n- [`compilerOptions.allowJs`](https://typescriptlang.org/tsconfig#allowJs) should be `true`.\n- [`compilerOptions.maxNodeModuleJsDepth`](https://typescriptlang.org/tsconfig#maxNodeModuleJsDepth) should be reasonably large, e.g. `10`.\n- [`compilerOptions.module`](https://typescriptlang.org/tsconfig#module) should be `\"node16\"` or `\"nodenext\"`.\n\n## Ignored files\n\nCode coverage analysis ignores:\n\n- `node_modules` directory files, e.g. `node_modules/foo/index.mjs`.\n- `test` directory files, e.g. `test/index.mjs`.\n- Files with `.test` prefixed before the extension, e.g. `foo.test.mjs`.\n- Files named `test` (regardless of extension), e.g. `test.mjs`.\n\n## Ignored lines\n\nIn source code, a comment (case insensitive) can be used to ignore code coverage ranges that start on the the next line:\n\n```js\n// coverage ignore next line\nif (false) console.log(\"Never runs.\");\n```\n\n## CLI\n\n### Command `coverage-node`\n\nSubstitutes the normal `node` command; any [`node` CLI options](https://nodejs.org/api/cli.html#cli_options) can be used to run a test script. If the script doesn’t error a code coverage analysis is reported to the console, and if coverage is incomplete and there isn’t a truthy `ALLOW_MISSING_COVERAGE` environment variable the process exits with code `1`.\n\n#### Examples\n\n[`npx`](https://docs.npmjs.com/cli/v8/commands/npx) can be used to quickly check code coverage for a script:\n\n```sh\nnpx coverage-node test.mjs\n```\n\nA [`package.json` script](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#scripts):\n\n```json\n{\n  \"scripts\": {\n    \"test\": \"coverage-node test.mjs\"\n  }\n}\n```\n\nA [`package.json` script](https://docs.npmjs.com/cli/v8/configuring-npm/package-json#scripts) that allows missing coverage:\n\n```json\n{\n  \"scripts\": {\n    \"test\": \"ALLOW_MISSING_COVERAGE=1 coverage-node test.mjs\"\n  }\n}\n```\n\n## Exports\n\nThe [npm](https://npmjs.com) package [`coverage-node`](https://npm.im/coverage-node) features [optimal JavaScript module design](https://jaydenseric.com/blog/optimal-javascript-module-design). It doesn’t have a main index module, so use deep imports from the ECMAScript modules that are exported via the [`package.json`](./package.json) field [`exports`](https://nodejs.org/api/packages.html#exports):\n\n- [`analyseCoverage.mjs`](./analyseCoverage.mjs)\n- [`reportCoverage.mjs`](./reportCoverage.mjs)\n","publish_time":1576990359471,"_cnpm_publish_time":1576990359471,"dist-tags":{"latest":"8.0.0"}}