@start/plugin-xargs
v2.0.1
Published
π Run task as parallel child process for each argument
Downloads
51
Readme
π plugin-xargs
Run task as parallel child process for each argument.
Install
$ yarn add --dev @start/plugin-xargs
Usage
Signature
xargs(taskName: string, options?: {}): (...args: string[])
taskName
Exported task name.
options
maxProcesses
βInfinity
by default
Example
import sequence from '@start/plugin-sequence'
import find from '@start/plugin-find'
import read from '@start/plugin-read'
import babel from '@start/plugin-lib-babel'
import write from '@start/plugin-write'
const babelConfig = {
// β¦
babelrc: false,
sourceMap: true,
}
export const task1 = (packageName) =>
sequence(
find(`${packageName}/src/**/*.js`),
read,
babel(babelConfig),
write(`${packageName}/build/`)
)
export const task2 => (...packageNames) = xargs('task1')(...packageNames)
// export const task2 = xargs('task1')