<commit_before># start-write

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

Write task for [Start](https://github.com/start-runner/start).

## Install

```sh
npm install --save-dev start-write
# or
yarn add --dev start-write
```

## Usage

```js
import start from 'start';
import reporter from 'start-pretty-reporter';
import files from 'start-files';
import clean from 'start-clean';
import babel from 'start-babel';
import write from 'start-write';

export const build= () => start(reporter())(
  files('build/'),
  clean(),
  files('lib/**/*.js'),
  babel({ sourceMaps: true }),
  write('build/')
);
```

This task relies on `[{ path, data, map }]` input and provides the same, see [documentation](https://github.com/start-runner/start#readme) for details.

## Arguments

`write(dir, encoding, sourcemapOptions)`

* `dir` – output directory
* `encoding` – `fs.writeFile` encoding option, `utf-8` by default
* `sourcemapOptions` – options using to generate Source Maps:
  * `extname` – sourcemap file extension, `'.map'` by default
  * `prefix` – prefix string which will be used to generate `sourceMappingURL` sourcemap comment, `''` by default<commit_msg>:pencil: update readme<commit_after># start-write

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

Write task for [Start](https://github.com/start-runner/start).

## Install

```sh
npm install --save-dev start-write
# or
yarn add --dev start-write
```

## Usage

```js
import start from 'start';
import reporter from 'start-pretty-reporter';
import files from 'start-files';
import clean from 'start-clean';
import babel from 'start-babel';
import write from 'start-write';

export const build= () => start(reporter())(
  files('build/'),
  clean(),
  files('lib/**/*.js'),
  babel({ sourceMaps: true }),
  write('build/')
);
```

This task relies on `[{ path, data, map }]` input and provides the same, see [documentation](https://github.com/start-runner/start#readme) for details.

## Arguments

`write(dir, encoding, sourcemapOptions)`

* `dir` – output directory, will be created automatically if it doesn't exists
* `encoding` – `fs.writeFile` encoding option, `utf-8` by default
* `sourcemapOptions` – options using to generate Source Maps:
  * `extname` – sourcemap file extension, `'.map'` by default
  * `prefix` – prefix string which will be used to generate `sourceMappingURL` sourcemap comment, `''` by default
{'fraction_non_alphanumeric': 0.18377795742387495, 'fraction_numerical': 0.0005389382915656157, 'mean_word_length': 5.217755443886097, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 24, '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': '5118112', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1223, 'n_words': 257}