{"name":"coverage-node","version":"3.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"],"main":"public","exports":{".":{"import":"./public/index.mjs","require":"./public/index.js"},"./public/":"./public/","./package":"./package.json","./package.json":"./package.json"},"bin":{"coverage-node":"cli/coverage-node.js"},"engines":{"node":"^10.17.0 || ^12.0.0 || >= 13.7.0"},"dependencies":{"@bcoe/v8-coverage":"^0.2.3","disposable-directory":"^2.0.0","kleur":"^3.0.3"},"devDependencies":{"eslint":"^7.2.0","eslint-config-env":"^14.0.3","eslint-config-prettier":"^6.11.0","eslint-plugin-import":"^2.21.2","eslint-plugin-jsdoc":"^27.0.7","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.1.3","hard-rejection":"^2.1.0","jsdoc-md":"^7.0.0","prettier":"^2.0.5","test-director":"^4.0.1"},"scripts":{"prepare":"npm run prepare:jsdoc && npm run prepare:prettier","prepare:jsdoc":"jsdoc-md","prepare:prettier":"prettier --write readme.md","test":"npm run test:eslint && npm run test:prettier && npm run test:api","test:eslint":"eslint .","test:prettier":"prettier -c .","test:api":"node cli/coverage-node -r hard-rejection/register test","prepublishOnly":"npm test"},"gitHead":"3923b1fc8d0d4e240d1a98cc9fb1c2d2aad74adf","_id":"coverage-node@3.0.0","_nodeVersion":"14.4.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-ZvUzQVrmQytLXxGdNIT3ke0LAkTg9id34ENuaoLvcMzx+qtwugzdPKfHsoirnuu8Az22Jb64rVS4reA7AKxiqQ==","shasum":"2dea3b2594bbfa31b939c8a1d9ec78da2787f6e2","tarball":"http://registry-npm.ywwl.com/coverage-node/download/coverage-node-3.0.0.tgz","fileCount":14,"unpackedSize":29392,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe5bpCCRA9TVsSAnZWagAACqMP/0LaeuSf6Ucm5ioirEw4\naBAuTd+fLfM5uxxgTNeE87I7DE6GLco+vD2g/RfeALerCZWrvb3xTAcGEnoC\nrc87QbbhcqecQKuzhaH6D6tblkNskVF6EdWhBDJW09+U0tGL/kU+2xqDpsJJ\n3GYv4Rkop/WIMloEt7ZrKVn3b/+A2l5gcYSGghzu+MfgRr0sxb8TpB98Qr1L\nFutEpPOj2IkI8BkD3lIONniNdy5BO7Sp71rVcefYosiPSyEbQfAsb23G/XPW\nYBUEHNkZS67sqL8kKyeopoNCtPgjTzmGb6ALelJfO29Ay6m/8+M41xML7mki\nW13+zFBXtNdVCMNZzqF9p6edw+xACJNIcEJp0UCiEulZ2YkpiDJDx5oTlqq8\nbQhFShfNhNQ0UyBit25A3yljP3qTdQh8OI4gxJ1AX8DNJA/2OjF//ZNM+yBM\ndwMGkJcA1Ohh6y1PUqc3+nRh+sTF4AstOo0MY8Q25/dlDIcmdXPWJhMR03/3\nRiHWRPZ/pv8VHtinPvnxax15klF+8xPgQ+dsaYmvB2I8GXHhSdN/4vctDSsy\nx8xSNARDWObWv3HiCeMNWg+TqK5eMPHTxMCjrZ+opT7trPVHgH8FPnikVeFb\nILX+z8RtHNnGTz0e/vTh0lsQy7FolCoEP4qQG9IZ9lYrq9xc1tTuUV1rBbIg\nMce2\r\n=v2np\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCL/g+2v5mXYD4W+2KQwY8G/DiCaoEovcVBxgfwysrzQQIhAJoTmxwwwY6xpe4qD49ktbdltD4zEauD4UHgG+6N69+Q"}],"size":8457,"noattachment":false,"key":"/coverage-node/-/coverage-node-3.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_3.0.0_1592113729610_0.7594693754690298"},"_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":1592113730099,"_cnpm_publish_time":1592113730099,"dist-tags":{"latest":"8.0.0"}}