Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

v8-to-istanbul

Package Overview
Dependencies
3
Maintainers
2
Versions
49
Issues
File Explorer

Advanced tools

v8-to-istanbul

convert from v8 coverage format to istanbul's format

    9.0.1latest

Version published
Maintainers
2
Weekly downloads
17,462,594
decreased by-12.77%

Weekly downloads

Changelog

Source

9.0.1 (2022-06-20)

Bug Fixes

  • update @jridgewell/trace-mapping (#194) (83d3ea2)

Readme

Source

v8-to-istanbul

Build Status Conventional Commits nycrc config on GitHub

converts from v8 coverage format to istanbul's coverage format.

Usage

const v8toIstanbul = require('v8-to-istanbul') // the path to the original source-file is required, as its contents are // used during the conversion algorithm. const converter = v8toIstanbul('./path-to-instrumented-file.js') await converter.load() // this is required due to async file reading. // provide an array of coverage information in v8 format. converter.applyCoverage([ { "functionName": "", "ranges": [ { "startOffset": 0, "endOffset": 520, "count": 1 } ], "isBlockCoverage": true }, // ... ]) // output coverage information in a form that can // be consumed by Istanbul. console.info(JSON.stringify(converter.toIstanbul()))

Ignoring Uncovered Lines

Sometimes you might find yourself wanting to ignore uncovered lines in your application (for example, perhaps you run your tests in Linux, but there's code that only executes on Windows).

To ignore lines, use the special comment /* c8 ignore next */.

ignoring the next line

const myVariable = 99 /* c8 ignore next */ if (process.platform === 'win32') console.info('hello world')

ignoring the next N lines

const myVariable = 99 /* c8 ignore next 3 */ if (process.platform === 'win32') { console.info('hello world') }

ignoring all lines until told

/* c8 ignore start */ function dontMindMe() { // ... } /* c8 ignore stop */

ignoring the same line as the comment

const myVariable = 99 const os = process.platform === 'darwin' ? 'OSXy' /* c8 ignore next */ : 'Windowsy'

Testing

To execute tests, simply run:

npm test

Keywords

FAQs

What is v8-to-istanbul?

convert from v8 coverage format to istanbul's format

Is v8-to-istanbul popular?

The npm package v8-to-istanbul receives a total of 13,898,313 weekly downloads. As such, v8-to-istanbul popularity was classified as popular.

Is v8-to-istanbul well maintained?

We found that v8-to-istanbul demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 2 open source maintainers collaborating on the project.

Last updated on 20 Jun 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc