How to use the cac.cac function in cac

To help you get started, we’ve selected a few cac examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Akryum / monorepo-run / src / bin / child-mono-run.js View on Github external
#!/usr/bin/env node

const { cac } = require('cac')
const { monorepoRun } = require('../')
const consola = require('consola')
const chalk = require('chalk')
const pkg = require('../../package.json')

const cli = cac()

cli.option('--patterns ', 'Folder glob patterns (by default will take yarn workspaces)')

cli.option('--concurrency ', 'Limit the number of active parallel tasks. `auto` = number of cpu cores. By default there is no limit.')

cli.option('--stream [throttle]', 'Stream output directly instead of waiting for the end. You can also throttle (ms) the output when streaming is enabled (default 200ms).', {
  default: false,
})

cli.option('--ui [layout]', 'Display a grid UI with interactive actions. Layout can be: row, column', {
  default: false,
})

cli.help()
cli.version(pkg.version)

cac

Simple yet powerful framework for building command-line apps.

MIT
Latest version published 2 years ago

Package Health Score

75 / 100
Full package analysis