@start/plugin-xargs
TypeScript icon, indicating that this package has built-in type declarations

2.0.1Β β€’Β PublicΒ β€’Β Published

πŸ”‚ 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')

Package Sidebar

Install

npm i @start/plugin-xargs

Weekly Downloads

16

Version

2.0.1

License

MIT

Unpacked Size

4.42 kB

Total Files

6

Last publish

Collaborators

  • fosimus
  • psxcode
  • deepsweet