<commit_before># start-istanbul

[![npm](https://img.shields.io/npm/v/start-istanbul.svg?style=flat-square)](https://www.npmjs.com/package/start-istanbul)
[![linux build](https://img.shields.io/travis/start-runner/istanbul.svg?label=linux&style=flat-square)](https://travis-ci.org/start-runner/istanbul)
[![windows build](https://img.shields.io/appveyor/ci/start-runner/istanbul.svg?label=windows&style=flat-square)](https://ci.appveyor.com/project/start-runner/istanbul)
[![coverage](https://img.shields.io/codecov/c/github/start-runner/istanbul.svg?style=flat-square)](https://codecov.io/github/start-runner/istanbul)
[![deps](https://img.shields.io/gemnasium/start-runner/istanbul.svg?style=flat-square)](https://gemnasium.com/start-runner/istanbul)

[Istanbul](https://istanbul.js.org/) (ES6+ ready using Babel recently) tasks for [Start](https://github.com/start-runner/start).

## Install

```
npm i -D start-istanbul
```

## Usage

The sequence of tasks is simple: "instrument" sources, run tests, report collected code coverage and then check the result against provided thresholds (optional).

```js
import start from 'start';
import reporter from 'start-pretty-reporter';
import files from 'start-files';
import clean from 'start-clean';
import * as istanbul from 'start-istanbul';
import mocha from 'start-mocha';

export function coverage() {
    return start(reporter())(
        files('coverage/'),
        clean(),
        files('lib/**/*.js'),
        istanbul.instrument(),
        files('test/**/*.js'),
        mocha(),
        istanbul.report([ 'lcovonly', 'html', 'text-summary' ]),
        istanbul.thresholds({ functions: 100 })
    );
}
```

Instrument task relies on array of files, see [documentation](https://github.com/start-runner/start#readme) for details.

## Arguments

### instrument

`istanbul.instrument(options)`

* `options` – [Istanbul instrumenter options](https://github.com/istanbuljs/istanbul-lib-instrument/blob/master/src/instrumenter.js)

### report

`istanbul.report(formats)`

* `formats` – [Istanbul reporter formats](https://github.com/istanbuljs/istanbul-reports/tree/master/lib), `[ 'lcovonly', 'text-summary' ]` by default<commit_msg>:pencil: [skip ci] update readme<commit_after># start-istanbul

[![npm](https://img.shields.io/npm/v/start-istanbul.svg?style=flat-square)](https://www.npmjs.com/package/start-istanbul)
[![linux build](https://img.shields.io/travis/start-runner/istanbul.svg?label=linux&style=flat-square)](https://travis-ci.org/start-runner/istanbul)
[![windows build](https://img.shields.io/appveyor/ci/start-runner/istanbul.svg?label=windows&style=flat-square)](https://ci.appveyor.com/project/start-runner/istanbul)
[![coverage](https://img.shields.io/codecov/c/github/start-runner/istanbul.svg?style=flat-square)](https://codecov.io/github/start-runner/istanbul)
[![deps](https://img.shields.io/gemnasium/start-runner/istanbul.svg?style=flat-square)](https://gemnasium.com/start-runner/istanbul)

[Istanbul](https://istanbul.js.org/) (ES6+ ready using Babel recently) tasks for [Start](https://github.com/start-runner/start).

## Install

```
npm i -D start-istanbul
```

## Usage

The sequence of tasks is simple: "instrument" sources, run tests, report collected code coverage and then check the result against provided thresholds (optional).

```js
import start from 'start';
import reporter from 'start-pretty-reporter';
import files from 'start-files';
import clean from 'start-clean';
import * as istanbul from 'start-istanbul';
import mocha from 'start-mocha';

export function coverage() {
    return start(reporter())(
        files('coverage/'),
        clean(),
        files('lib/**/*.js'),
        istanbul.instrument({ esModules: true }),
        files('test/**/*.js'),
        mocha(),
        istanbul.report([ 'lcovonly', 'html', 'text-summary' ]),
        istanbul.thresholds({ functions: 100 })
    );
}
```

Instrument task relies on array of files, see [documentation](https://github.com/start-runner/start#readme) for details.

## Arguments

### instrument

`istanbul.instrument(options)`

* `options` – [Istanbul instrumenter options](https://github.com/istanbuljs/istanbul-lib-instrument/blob/master/src/instrumenter.js)

### report

`istanbul.report(formats)`

* `formats` – [Istanbul reporter formats](https://github.com/istanbuljs/istanbul-reports/tree/master/lib), `[ 'lcovonly', 'text-summary' ]` by default
{'fraction_non_alphanumeric': 0.1784580498866213, 'fraction_numerical': 0.0018140589569160999, 'mean_word_length': 4.773560209424084, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 30, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1236632', 'n_tokens_mistral': 1497, 'n_tokens_neox': 1432, 'n_words': 247}