Skip to content
This repository has been archived by the owner on Mar 27, 2020. It is now read-only.

Latest commit

 

History

History

plugin-xargs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

🔂 plugin-xargs

npm linux windows coverage deps

Run task as parallel child process for each argument.

Install

$ yarn add --dev @start/plugin-xargs
# or
$ npm install --save-dev @start/plugin-xargs

Usage

Signature

xargs(taskName: string, options?: {}): (...args: string[])

taskName

Exported task name.

options

  • maxProcessesInfinity 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')