{"_id":"@anthony-redfox/v8-to-istanbul","name":"@anthony-redfox/v8-to-istanbul","dist-tags":{"latest":"9.3.0"},"versions":{"9.3.0":{"name":"@anthony-redfox/v8-to-istanbul","version":"9.3.0","description":"convert from v8 coverage format to istanbul's format","main":"index.js","types":"index.d.ts","scripts":{"fix":"standard --fix","snapshot":"TAP_SNAPSHOT=1 tap test/*.js","test":"c8 --reporter=html --reporter=text tap --no-coverage test/*.js","posttest":"standard","coverage":"c8 report --check-coverage"},"repository":{"type":"git","url":"git+https://github.com/Second-Live/v8-to-istanbul.git"},"keywords":["istanbul","v8","coverage"],"standard":{"ignore":["**/test/fixtures"]},"author":{"name":"Ben Coe","email":"ben@npmjs.com"},"license":"ISC","dependencies":{"@jridgewell/trace-mapping":"^0.3.25","@types/istanbul-lib-coverage":"^2.0.6","convert-source-map":"^2.0.0","esbuild":"^0.20.2","vlq":"^2.0.4"},"devDependencies":{"@types/node":"^20.12.4","c8":"^7.2.1","semver":"^7.6.0","should":"13.2.3","source-map":"^0.7.4","standard":"^17.1.0","tap":"^16.0.0"},"engines":{"node":">=18.0.0"},"bugs":{"url":"https://github.com/Second-Live/v8-to-istanbul/issues"},"homepage":"https://github.com/Second-Live/v8-to-istanbul#readme","_id":"@anthony-redfox/v8-to-istanbul@9.3.0","gitHead":"e45ac00345f1b900ef5a2cd044770155a0ce5c69","_nodeVersion":"21.7.1","_npmVersion":"10.5.0","dist":{"integrity":"sha512-zGGKI8sQYwHHkWro5UPtxU7yPdu/a8rGwBTI0+ZDMtFcyz1NpqcLZcPwYQCII2Y/8cJPRjv8xxFjAHzXgA+3LA==","shasum":"49433cad0aa719a99a41c27fbee6c4f9c63f1587","tarball":"https://registry.npmjs.org/@anthony-redfox/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz","fileCount":12,"unpackedSize":30602,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJX4aN8pogNnCQt5PRHtoNqVUPN3NhVnkDRhP+VNOQvwIhAMEJcqKcU9YhkNc6MMJRAgvJ3MfWWD41OJEWMbXM0t9W"}]},"_npmUser":{"name":"anthony-redfox","email":"anton.redfox@gmail.com"},"directories":{},"maintainers":[{"name":"anthony-redfox","email":"anton.redfox@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/v8-to-istanbul_9.3.0_1712231841033_0.9437344223671413"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-04T11:57:20.921Z","9.3.0":"2024-04-04T11:57:21.194Z","modified":"2024-04-04T11:57:21.433Z"},"maintainers":[{"name":"anthony-redfox","email":"anton.redfox@gmail.com"}],"description":"convert from v8 coverage format to istanbul's format","homepage":"https://github.com/Second-Live/v8-to-istanbul#readme","keywords":["istanbul","v8","coverage"],"repository":{"type":"git","url":"git+https://github.com/Second-Live/v8-to-istanbul.git"},"author":{"name":"Ben Coe","email":"ben@npmjs.com"},"bugs":{"url":"https://github.com/Second-Live/v8-to-istanbul/issues"},"license":"ISC","readme":"# v8-to-istanbul\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/istanbuljs/v8-to-istanbul/ci.yaml?branch=master)](https://github.com/istanbuljs/v8-to-istanbul/actions)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n![nycrc config on GitHub](https://img.shields.io/nycrc/istanbuljs/v8-to-istanbul)\n\nconverts from v8 coverage format to [istanbul's coverage format](https://github.com/gotwarlost/istanbul/blob/master/coverage.json.md).\n\n## Usage\n\n```js\nconst v8toIstanbul = require('v8-to-istanbul')\n// the path to the original source-file is required, as its contents are\n// used during the conversion algorithm.\nconst converter = v8toIstanbul('./path-to-instrumented-file.js')\nawait converter.load() // this is required due to async file reading.\n// provide an array of coverage information in v8 format.\nconverter.applyCoverage([\n  {\n    \"functionName\": \"\",\n    \"ranges\": [\n      {\n        \"startOffset\": 0,\n        \"endOffset\": 520,\n        \"count\": 1\n      }\n    ],\n    \"isBlockCoverage\": true\n  },\n  // ...\n])\n// output coverage information in a form that can\n// be consumed by Istanbul.\nconsole.info(JSON.stringify(converter.toIstanbul()))\n```\n\n## Ignoring Uncovered Lines\n\nSometimes you might find yourself wanting to ignore uncovered lines\nin your application (for example, perhaps you run your tests in Linux, but\nthere's code that only executes on Windows).\n\nTo ignore lines, use the special comment `/* v8 ignore next */`.\n\n**NOTE**: Before version `9.2.0` the ignore hint had to contain `c8` keyword, e.g. `/* c8 ignore ...`.\n\n### ignoring the next line\n\n```js\nconst myVariable = 99\n/* v8 ignore next */\nif (process.platform === 'win32') console.info('hello world')\n```\n\n### ignoring the next N lines\n\n```js\nconst myVariable = 99\n/* v8 ignore next 3 */\nif (process.platform === 'win32') {\n  console.info('hello world')\n}\n```\n\n### ignoring all lines until told\n\n```js\n/* v8 ignore start */\nfunction dontMindMe() {\n  // ...\n}\n/* v8 ignore stop */\n```\n\n### ignoring the same line as the comment\n\n```js\nconst myVariable = 99\nconst os = process.platform === 'darwin' ? 'OSXy' /* v8 ignore next */ : 'Windowsy' \n```\n\n## Testing\n\nTo execute tests, simply run:\n\n```bash\nnpm test\n```\n","readmeFilename":"README.md"}