npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@lernify/run

v1.0.2

Published

Run an npm script in each package that contains that script

Downloads

65

Readme

@lerna/run

Run an npm script in each package that contains that script

Install lerna for access to the lerna CLI.

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 accepts all 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.

--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 script 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 script 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 scripts.

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

$ lerna run build --profile

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 run build --profile --profile-location=logs/profile/