Socket
Socket
Sign inDemoInstall

@lerna/run-lifecycle

Package Overview
Dependencies
Maintainers
2
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lerna/run-lifecycle

An internal Lerna tool


Version published
Weekly downloads
513K
increased by0.96%
Maintainers
2
Weekly downloads
 
Created

What is @lerna/run-lifecycle?

@lerna/run-lifecycle is a package that allows you to run lifecycle scripts for npm packages within a Lerna-managed monorepo. It helps in executing pre-defined scripts like preinstall, install, postinstall, prepublish, publish, postpublish, etc., across multiple packages in a monorepo setup.

What are @lerna/run-lifecycle's main functionalities?

Run Predefined Lifecycle Scripts

This feature allows you to run predefined lifecycle scripts like preinstall, install, postinstall, etc., for a given package. The code sample demonstrates how to run the 'preinstall' script for a package.

const { runLifecycle } = require('@lerna/run-lifecycle');

async function runScript(pkg, script) {
  await runLifecycle(pkg, script, {
    stdio: 'inherit',
  });
}

const pkg = { name: 'my-package', location: '/path/to/package' };
runScript(pkg, 'preinstall');

Custom Script Execution

This feature allows you to run custom scripts defined in the package.json of a given package. The code sample demonstrates how to run a custom script named 'custom-script' for a package.

const { runLifecycle } = require('@lerna/run-lifecycle');

async function runCustomScript(pkg, script) {
  await runLifecycle(pkg, script, {
    stdio: 'inherit',
    scriptShell: '/bin/bash',
  });
}

const pkg = { name: 'my-package', location: '/path/to/package' };
runCustomScript(pkg, 'custom-script');

Other packages similar to @lerna/run-lifecycle

Keywords

FAQs

Package last updated on 07 Nov 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc