Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@lerna/run-lifecycle
Advanced tools
@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.
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');
npm-lifecycle is a package that provides the functionality to run lifecycle scripts for npm packages. It is similar to @lerna/run-lifecycle but is not specifically designed for monorepo setups managed by Lerna. It can be used for individual npm packages.
Yarn is a package manager that also supports running lifecycle scripts for packages. While it is not a direct replacement for @lerna/run-lifecycle, it provides similar functionalities in terms of script execution and can be used in monorepo setups with Yarn Workspaces.
pnpm is another package manager that supports running lifecycle scripts. It is known for its efficient handling of node_modules and can be used in monorepo setups. Like Yarn, it provides similar functionalities but is not specifically tailored for Lerna-managed monorepos.
@lerna/run-lifecycle
An internal Lerna tool
You probably shouldn't, at least directly.
Install lerna for access to the lerna
CLI.
FAQs
An internal Lerna tool
The npm package @lerna/run-lifecycle receives a total of 296,674 weekly downloads. As such, @lerna/run-lifecycle popularity was classified as popular.
We found that @lerna/run-lifecycle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.