@lerna/exec

TODO

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
Last updated 7 years ago by evocateur .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @lerna/exec 
SYNC missed versions from official npm registry.

lerna exec

Execute an arbitrary command in each package

Install lerna for access to the lerna CLI.

Usage

$ lerna exec -- <command> [..args] # runs the command in all packages
$ lerna exec -- rm -rf ./node_modules
$ lerna exec -- protractor conf.js

Run an arbitrary command in each package. A double-dash (--) is necessary to pass dashed flags to the spawned command, but is not necessary when all the arguments are positional.

The name of the current package is available through the environment variable LERNA_PACKAGE_NAME:

$ lerna exec -- npm view \$LERNA_PACKAGE_NAME

You may also run a script located in the root dir, in a complicated dir structure through the environment variable LERNA_ROOT_PATH:

$ lerna exec -- node \$LERNA_ROOT_PATH/scripts/some-script.js

Options

lerna exec accepts all filter flags.

$ lerna exec --scope my-component -- ls -la

The commands are spawned in parallel, using the concurrency given (except with --parallel). The output is piped through, so not deterministic. If you want to run the command in one package after another, use it like this:

$ lerna exec --concurrency 1 -- ls -la

--stream

Stream output from child processes immediately, prefixed with the originating package name. This allows output from different packages to be interleaved.

$ lerna exec --stream -- babel src -d lib

--parallel

Similar to --stream, but completely disregards concurrency and topological sorting, running a given command or script immediately in all matching packages with prefixed streaming output. This is the preferred flag for long-running processes such as babel src -d lib -w run over many packages.

$ lerna exec --parallel -- babel src -d lib -w

Note: It is advised to constrain the scope of this command when using the --parallel flag, as spawning dozens of subprocesses may be harmful to your shell's equanimity (or maximum file descriptor limit, for example). YMMV

--no-bail

# Run a command, ignoring non-zero (error) exit codes
$ lerna exec --no-bail <command>

By default, lerna exec will exit with an error if any execution returns a non-zero exit code. Pass --no-bail to disable this behavior, executing in all packages regardless of exit code.

--no-prefix

Disable package name prefixing when output is streaming (--stream or --parallel). This option can be useful when piping results to other processes, such as editor plugins.

--profile

Profiles the command executions and produces a performance profile which can be analyzed using DevTools in a Chromium-based browser (direct url: devtools://devtools/bundled/devtools_app.html). The profile shows a timeline of the command executions where each execution is assigned to an open slot. The number of slots is determined by the --concurrency option and the number of open slots is determined by --concurrency minus the number of ongoing operations. The end result is a visualization of the parallel execution of your commands.

The default location of the performance profile output is at the root of your project.

$ lerna exec --profile -- <command>

Note: Lerna will only profile when topological sorting is enabled (i.e. without --parallel and --no-sort).

--profile-location <location>

You can provide a custom location for the performance profile output. The path provided will be resolved relative to the current working directory.

$ lerna exec --profile --profile-location=logs/profile/ -- <command>

Current Tags

  • 6.6.2                                ...           latest (2 years ago)
  • 6.5.0                                ...           next (2 years ago)

113 Versions

  • 6.6.2 [deprecated]           ...           2 years ago
  • 6.6.1 [deprecated]           ...           2 years ago
  • 6.6.0 [deprecated]           ...           2 years ago
  • 6.5.1 [deprecated]           ...           2 years ago
  • 6.5.0 [deprecated]           ...           2 years ago
  • 6.5.0-alpha.2 [deprecated]           ...           2 years ago
  • 6.5.0-alpha.1 [deprecated]           ...           2 years ago
  • 6.5.0-alpha.0 [deprecated]           ...           2 years ago
  • 6.4.2-beta.0 [deprecated]           ...           2 years ago
  • 6.4.1 [deprecated]           ...           2 years ago
  • 6.4.0 [deprecated]           ...           2 years ago
  • 6.3.1-beta.8 [deprecated]           ...           2 years ago
  • 6.3.1-beta.6 [deprecated]           ...           2 years ago
  • 6.3.1-beta.5 [deprecated]           ...           2 years ago
  • 6.3.1-beta.4 [deprecated]           ...           2 years ago
  • 6.3.1-beta.3 [deprecated]           ...           2 years ago
  • 6.3.1-beta.2 [deprecated]           ...           2 years ago
  • 6.3.1-beta.1 [deprecated]           ...           2 years ago
  • 6.3.1-beta.0 [deprecated]           ...           2 years ago
  • 6.3.0 [deprecated]           ...           2 years ago
  • 6.2.0 [deprecated]           ...           2 years ago
  • 6.1.0 [deprecated]           ...           2 years ago
  • 6.0.3 [deprecated]           ...           2 years ago
  • 6.0.2 [deprecated]           ...           2 years ago
  • 6.0.1 [deprecated]           ...           2 years ago
  • 6.0.0 [deprecated]           ...           2 years ago
  • 6.0.0-alpha.2 [deprecated]           ...           2 years ago
  • 6.0.0-alpha.1 [deprecated]           ...           2 years ago
  • 5.6.2 [deprecated]           ...           2 years ago
  • 6.0.0-alpha.0 [deprecated]           ...           2 years ago
  • 5.6.1 [deprecated]           ...           2 years ago
  • 5.6.0 [deprecated]           ...           2 years ago
  • 5.5.4 [deprecated]           ...           2 years ago
  • 5.5.3 [deprecated]           ...           2 years ago
  • 5.5.2 [deprecated]           ...           2 years ago
  • 5.5.1 [deprecated]           ...           2 years ago
  • 5.5.0 [deprecated]           ...           2 years ago
  • 5.4.3 [deprecated]           ...           2 years ago
  • 5.4.2 [deprecated]           ...           2 years ago
  • 5.4.1 [deprecated]           ...           2 years ago
  • 5.4.0 [deprecated]           ...           2 years ago
  • 5.3.0 [deprecated]           ...           2 years ago
  • 5.2.0 [deprecated]           ...           2 years ago
  • 5.1.8 [deprecated]           ...           2 years ago
  • 5.1.7 [deprecated]           ...           2 years ago
  • 5.1.6 [deprecated]           ...           3 years ago
  • 5.1.5 [deprecated]           ...           3 years ago
  • 5.1.4 [deprecated]           ...           3 years ago
  • 5.1.3 [deprecated]           ...           3 years ago
  • 5.1.2 [deprecated]           ...           3 years ago
  • 5.1.1 [deprecated]           ...           3 years ago
  • 5.1.0 [deprecated]           ...           3 years ago
  • 5.1.0-alpha.0 [deprecated]           ...           3 years ago
  • 5.0.0 [deprecated]           ...           3 years ago
  • 5.0.0-alpha.2 [deprecated]           ...           3 years ago
  • 5.0.0-alpha.1 [deprecated]           ...           3 years ago
  • 5.0.0-alpha.0 [deprecated]           ...           3 years ago
  • 4.0.0 [deprecated]           ...           4 years ago
  • 3.21.0 [deprecated]           ...           5 years ago
  • 3.20.0 [deprecated]           ...           5 years ago
  • 3.18.5 [deprecated]           ...           5 years ago
  • 3.18.4 [deprecated]           ...           5 years ago
  • 3.18.0 [deprecated]           ...           5 years ago
  • 3.16.5 [deprecated]           ...           5 years ago
  • 3.16.0 [deprecated]           ...           5 years ago
  • 3.15.0 [deprecated]           ...           6 years ago
  • 3.14.2 [deprecated]           ...           6 years ago
  • 3.14.0 [deprecated]           ...           6 years ago
  • 3.13.3 [deprecated]           ...           6 years ago
  • 3.13.1 [deprecated]           ...           6 years ago
  • 3.13.0 [deprecated]           ...           6 years ago
  • 3.12.1 [deprecated]           ...           6 years ago
  • 3.12.0 [deprecated]           ...           6 years ago
  • 3.11.0 [deprecated]           ...           6 years ago
  • 3.10.6 [deprecated]           ...           6 years ago
  • 3.10.1 [deprecated]           ...           6 years ago
  • 3.10.0 [deprecated]           ...           6 years ago
  • 3.9.0 [deprecated]           ...           6 years ago
  • 3.8.5 [deprecated]           ...           6 years ago
  • 3.8.1 [deprecated]           ...           6 years ago
  • 3.7.2 [deprecated]           ...           6 years ago
  • 3.7.1 [deprecated]           ...           6 years ago
  • 3.7.0 [deprecated]           ...           6 years ago
  • 3.6.0 [deprecated]           ...           6 years ago
  • 3.5.0 [deprecated]           ...           6 years ago
  • 3.3.2 [deprecated]           ...           6 years ago
  • 3.3.0 [deprecated]           ...           6 years ago
  • 3.1.3 [deprecated]           ...           6 years ago
  • 3.1.2 [deprecated]           ...           6 years ago
  • 3.1.0 [deprecated]           ...           6 years ago
  • 3.0.6 [deprecated]           ...           6 years ago
  • 3.0.5 [deprecated]           ...           6 years ago
  • 3.0.2 [deprecated]           ...           6 years ago
  • 3.0.0 [deprecated]           ...           6 years ago
  • 3.0.0-rc.0 [deprecated]           ...           6 years ago
  • 3.0.0-beta.21 [deprecated]           ...           7 years ago
  • 3.0.0-beta.20 [deprecated]           ...           7 years ago
  • 3.0.0-beta.19 [deprecated]           ...           7 years ago
  • 3.0.0-beta.18 [deprecated]           ...           7 years ago
  • 3.0.0-beta.17 [deprecated]           ...           7 years ago
  • 3.0.0-beta.15 [deprecated]           ...           7 years ago
  • 3.0.0-beta.14 [deprecated]           ...           7 years ago
  • 3.0.0-beta.13 [deprecated]           ...           7 years ago
  • 3.0.0-beta.12 [deprecated]           ...           7 years ago
  • 3.0.0-beta.11 [deprecated]           ...           7 years ago
  • 3.0.0-beta.10 [deprecated]           ...           7 years ago
  • 3.0.0-beta.9 [deprecated]           ...           7 years ago
  • 3.0.0-beta.7 [deprecated]           ...           7 years ago
  • 3.0.0-beta.4 [deprecated]           ...           7 years ago
  • 3.0.0-beta.3 [deprecated]           ...           7 years ago
  • 3.0.0-beta.2 [deprecated]           ...           7 years ago
  • 3.0.0-beta.1 [deprecated]           ...           7 years ago
  • 3.0.0-beta.0 [deprecated]           ...           7 years ago
Downloads
Total 52
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (0)
None
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE