Socket
Socket
Sign inDemoInstall

@lerna/run

Package Overview
Dependencies
221
Maintainers
2
Versions
113
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @lerna/run

Run an npm script in each package that contains that script


Version published
Weekly downloads
495K
increased by6.14%
Maintainers
2
Install size
5.61 MB
Created
Weekly downloads
 

Package description

What is @lerna/run?

@lerna/run is a part of the Lerna monorepo management toolset. It allows you to run scripts or commands across multiple packages in a monorepo, making it easier to manage and automate tasks in a multi-package repository.

What are @lerna/run's main functionalities?

Run npm scripts in all packages

This command runs the 'test' script in all packages that contain it. It's useful for ensuring that all packages pass their tests before a release.

lerna run test

Run npm scripts in specific packages

This command runs the 'build' script only in the package named 'my-package'. This is useful for targeting specific packages for certain tasks.

lerna run build --scope my-package

Run npm scripts with parallel execution

This command runs the 'lint' script in all packages in parallel, which can speed up the process significantly compared to running them sequentially.

lerna run lint --parallel

Run npm scripts with a specific concurrency

This command runs the 'test' script in all packages but limits the number of concurrent executions to 4. This can help manage resource usage on your machine.

lerna run test --concurrency 4

Other packages similar to @lerna/run

Changelog

Source

3.7.2 (2018-12-21)

Bug Fixes

  • pack-directory: Accept lazy Package, passing directory as second parameter (c6819c0)
  • package: Add Package.lazy() helper (4aa9d37)
  • package: Chain self from serialize() method for parity with refresh() (98c812c)
  • publish: Re-order --git-reset flag in options (0653af9)
  • publish: Remove unused --npm-client option (4e7eaef)
  • symlink-binary: Use Package.lazy() instead of private resolver (83fe3ef)
  • version: Prevent clobbering composed --yes option (f3816be)

Readme

Source

@lerna/run

Run an npm script in each package that contains that script

Usage

$ lerna run <script> -- [..args] # runs npm run my-script in all packages that have it
$ lerna run test
$ lerna run build

# watch all packages and transpile on change, streaming prefixed output
$ lerna run --parallel watch

Run an npm script in each package that contains that script. A double-dash (--) is necessary to pass dashed arguments to the script execution.

Options

lerna run respects the --concurrency, --scope, and --ignore flags (see Filter Flags).

$ lerna run --scope my-component test

--npm-client <client>

Must be an executable that knows how to run npm lifecycle scripts. The default --npm-client is npm.

$ lerna run build --npm-client=yarn

May also be configured in lerna.json:

{
  "command": {
    "run": {
      "npmClient": "yarn"
    }
  }
}

--stream

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

$ lerna run watch --stream

--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 npm run watch run over many packages.

$ lerna run watch --parallel

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 an npm script in all packages that contain it, ignoring non-zero (error) exit codes
$ lerna run --no-bail test

By default, lerna run will exit with an error if any script run returns a non-zero exit code. Pass --no-bail to disable this behavior, running the script in all packages that contain it regardless of exit code.

Keywords

FAQs

Last updated on 21 Dec 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc