{"name":"coverage-node","version":"5.0.1","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"],"main":"./public/index.mjs","exports":{".":"./public/index.mjs","./public/*":"./public/*","./package":"./package.json","./package.json":"./package.json"},"bin":{"coverage-node":"cli/coverage-node.mjs"},"engines":{"node":"^12.20 || >= 14.13"},"dependencies":{"@bcoe/v8-coverage":"^0.2.3","disposable-directory":"^4.0.0","kleur":"^4.1.4"},"devDependencies":{"eslint":"^7.25.0","eslint-config-env":"^19.0.2","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-jsdoc":"^33.0.0","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.4.0","jsdoc-md":"^10.1.0","prettier":"^2.2.1","snapshot-assertion":"^3.0.0","test-director":"^6.0.0"},"scripts":{"jsdoc":"jsdoc-md","test":"npm run test:eslint && npm run test:prettier && npm run test:jsdoc && npm run test:api","test:eslint":"eslint --ext mjs,js .","test:prettier":"prettier -c .","test:jsdoc":"jsdoc-md -c","test:api":"node cli/coverage-node.mjs test/index.mjs","prepublishOnly":"npm test"},"gitHead":"5c9fa478053d3866dd2a01e0814496a567f64281","_id":"coverage-node@5.0.1","_nodeVersion":"16.0.0","_npmVersion":"7.11.1","dist":{"integrity":"sha512-/9T/cH0EeM4CrvqhYBkvmVR8QrYzIZSDT9Peb3FViz7tHYmdvtil3cYjrey+TWdfhNjnJ8q/5Dz/JBx6nwBfNQ==","shasum":"75375876afeecce73b49ee7cba25a5618a93419e","tarball":"http://registry-npm.ywwl.com/coverage-node/download/coverage-node-5.0.1.tgz","fileCount":15,"unpackedSize":32988,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgjivECRA9TVsSAnZWagAAD+oP/2AaKEPvLUmeSj9p3GUn\nOdY3FB5F7+Pw9/3YBhvmA9D5hNSqEfgsPz162Kk87naTlmtdpFpY69yxOqnm\n+feorqrVPmGFTVSmhpgn7n0RyjiVmi5Sx4CLGfFADl0b7mYubbNjTdSOBGD+\nIaT5I0ghpv31DQ2pOMmVHJEGC8/FoqhSSPRbdoYL4g9m8qDtnyGMQbjVj+a/\nszd0QL10mYWG0FnOHGRkWB4llIAqmUnHd0/N8YZED8spoFp2v2CMvCmiCqxf\n9WFw9oYzfXjKIHV8vg9kYIgjjQieVhlC1MB/J5z+ncL1XhtZl3kiIgGglMe8\nRDYHoHlS0lmjtq2m4LjhCN2gY49mYVBToyymoOhTXLuSfQcJFaNvsIZ6rc24\n4uIrsJx3Y3X0F9l4+RvjrqZYZAdKE2F9/9kz1m/dZpBYm9KpCTFTOylXvirA\nUQ/4RbWqO5rZQINZM0W57BwXUeuk5w+BaYV7kiGXHlpO2e629m4z90fKdyXl\nWj8BvYKabLPw4uzt4TG42ttRRqiPF5Fi2u7W3wgT3gDe7hyBClpVyRvf/g6G\nhknIgTHotxc6EXMdJMDl7r+1kMKJ5GbrQYiyLIqGYVq7VanN0QEPBAHkWGaJ\nyBxB6hGKtPd+Sq6nxAf3htf3n8MksoulLjnLOexd82+FIQjDjxqBExM5tZLy\no2xR\r\n=UL5m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+edwOS7NW2OUIAr6YEJCscEN3+Ln/ywZlFhVxIb22JgIgN6yjZm/tcaLkcaYWV5E7Kaao+R7IDeQ/0xjTOeV249s="}],"size":9792,"noattachment":false,"key":"/coverage-node/-/coverage-node-5.0.1.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_5.0.1_1619930052233_0.05107268550618205"},"_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":1619930052381,"_cnpm_publish_time":1619930052381,"dist-tags":{"latest":"8.0.0"}}