Catalog npm
PACKAGE EXPLORERView in registry

@0x-lerna-fork/exec

npm

Execute an arbitrary command in each package

commandlerna
Versions collected3
Direct dependencies6From release 3.16.3
Last observed20 Oct, 22:18 UTC

README

Current package documentation

@0x-lerna-fork/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 respects the --concurrency, --scope, and --ignore flags (see 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.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 3

Collected releases
VersionPublishedDirect dependenciesOpen version
3.16.3Registry latest22 Jul 20196
3.16.222 Jul 20196
3.0.0-beta.2224 Jul 20186

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
lerna/lerna

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:18 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:dc2458862440f88adb70df7585cb5d64a89aaf766d047f76f53721440b0f9b3c