start-split
Version:
Input task splitter for Start
61 lines (44 loc) • 2.56 kB
Markdown
# start-split
[](https://www.npmjs.com/package/start-split)
[](https://circleci.com/gh/effervescentia/start-split)
[](https://ci.appveyor.com/project/effervescentia/start-split)
[](https://codecov.io/github/effervescentia/start-split)
[](https://david-dm.org/effervescentia/start-split)
[](https://github.com/semantic-release/semantic-release)
[](http://commitizen.github.io/cz-cli/)
[](https://greenkeeper.io/)
split task pipelines for [Start](https://github.com/start-runner/start)
Apply a different set of tasks to each directory. Partially to overcome
[`start-write`](https://github.com/start-runner/write) stripping the root
directory for cases when relative directory structure must be retained (simple typescript + mocha).
## Install
```sh
npm install --save-dev start-split
# or
yarn add --dev start-split
```
## Usage
```js
import Start from 'start';
import reporter from 'start-pretty-reporter';
import files from 'start-files';
import read from 'start-read';
import write from 'start-write';
import split from 'start-split';
const start = Start(reporter());
export const task = () => start(
files([ 'lib/**/*.js', 'test/**/*.js' ]),
read(),
split({
lib: () => [ write('build/') ],
test: () => [ write('testBuild/') ]
})
);
```
This task relies on `[{ path, data, map }]` input and provides the same, see [documentation](https://github.com/start-runner/start#readme) for details.
## Arguments
`split(map, concurrent)`
* `map` – A map of directory name to a function that returns an array of start tasks.
* `concurrent` – Run task pipelines simultaneously using [`start-concurrent`][start-concurrent].
Defaults to `true`.
[start-concurrent]: https://github.com/start-runner/concurrent