{"name":"coverage-node","version":"8.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","esm","mjs"],"exports":{"./analyseCoverage.mjs":"./analyseCoverage.mjs","./package.json":"./package.json","./reportCoverage.mjs":"./reportCoverage.mjs"},"bin":{"coverage-node":"coverage-node.mjs"},"engines":{"node":"^14.17.0 || ^16.0.0 || >= 18.0.0"},"dependencies":{"@bcoe/v8-coverage":"^0.2.3","@types/node":"*","disposable-directory":"^6.0.0","kleur":"^4.1.5"},"devDependencies":{"eslint":"^8.22.0","eslint-plugin-simple-import-sort":"^7.0.0","prettier":"^2.7.1","replace-stack-traces":"^2.0.0","snapshot-assertion":"^4.0.2","test-director":"^9.0.0","typescript":"^4.7.4"},"scripts":{"eslint":"eslint .","prettier":"prettier -c .","types":"tsc -p jsconfig.json","tests":"node coverage-node.mjs test.mjs","test":"npm run eslint && npm run prettier && npm run types && npm run tests","prepublishOnly":"npm test"},"gitHead":"98b702a5a6cb17a2852bbe3a1fa838da9d04e3c2","_id":"coverage-node@8.0.0","_nodeVersion":"18.7.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-nT0sF6HsHsQ3hUsFhMt98DJZeSND0ImQQLPhO2AcftDWZ9sINUEl3Idq7uGpoaPl/nlTk7O0hde5JQriExVEUg==","shasum":"465bf8932a4c9db122fd6fcd953ea3089b835470","tarball":"http://registry-npm.ywwl.com/coverage-node/download/coverage-node-8.0.0.tgz","fileCount":11,"unpackedSize":20546,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLlhpmaVP4HN3GZS5SVUmbFwxcfvHopyx0SqBQDx9JtwIhAKlSMaTjpZ7lhDtfjAU2FoFbPNKQTBHDdARUUh3fB9Hy"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/cF7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrq8RAAopxkQLOhMnEHbjQOdbYSiayrFDjlVB8ibktVXqAFH/pRBtDQ\r\nE5TW+Aba7iGqQA4XlmgHaU3AwGhdDAgxTS4R6mMi9pUW8rlXBuYaGCXgOHlj\r\nqdHlZjZ40h98fGChkxgX0yP5xAL+XA8DVfTkaNRWgxn4RgjubwBy4iwmHZVi\r\nCLV3HBXpVOyqG/4dgpjEd5X4JYnuioniEHatmqLmxvJ6xGQSt9fbgjBZpRZQ\r\noLTrCuHKCd+kDobuLC8vkYrtNgfPIh6iguLGps5pu1QgbX5XGr5PDTibyWoV\r\n0M3q0AB1c+6cAyq/VJn7T8UFfmAw0UTG19hB2OhEOnkWVHQa8mxg+/mbmfuF\r\nPv4rXlGl1FA6sPphLwzwvryHQzjZf+ssUi2eQTPTtv3dGeMWPeeHsO3BYd9G\r\n+54KPBJp+Fy7gPmkg+sSHSG0DYLXdTUg6AE43NqKCqWp0tcSqHqr/prBtOCa\r\n3iuypE1qlhmgvXzjw7wOTOeYlJ/1XP457b9hr4+I4SZ/yCHhL7dxxsTsExBB\r\n6pM9cWbo8SrdXXnBRcO+9/E5qSWZCy7RdjmUzcJ0NyTUrbFu1sEmfdk1CTYu\r\nEunRqqd6G4Ak/ss39IJQI0hMsEbgO4SxSjDTmAIgLl5HLVxlduscynxB9f1g\r\nddSZXyFc9PjYUtcaLaJ+bd4bdZAg2wGjZyo=\r\n=GxLv\r\n-----END PGP SIGNATURE-----\r\n","size":6883,"noattachment":false,"key":"/coverage-node/-/coverage-node-8.0.0.tgz"},"_npmUser":{"name":"jaydenseric","email":"me@jaydenseric.com"},"directories":{},"maintainers":[{"name":"jaydenseric","email":"me@jaydenseric.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/coverage-node_8.0.0_1660797307213_0.3021283272592963"},"_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":1660797307379,"_cnpm_publish_time":1660797307379,"dist-tags":{"latest":"8.0.0"}}