# @pnpm/npm-lifecycle

> JavaScript package lifecycle hook runner

Latest version **1100.1.0** (published 2026-08-27) · Artistic-2.0 license · 0 weekly downloads

## Install

```sh
npm install @pnpm/npm-lifecycle
pnpm add @pnpm/npm-lifecycle
yarn add @pnpm/npm-lifecycle
bun add @pnpm/npm-lifecycle
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 1100.1.0 |
| Published | 2026-08-27 |
| First published | 2021-10-31 |
| Weekly downloads | 0 |
| License | Artistic-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=22.13 |
| Dependencies | 7 |
| Unpacked size | 29.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Mike Sherov |
| Maintainers | pnpmuser, zkochan |
| Keywords | npm, lifecycle, hook, runner |

## Links

- npm: https://www.npmjs.com/package/@pnpm/npm-lifecycle
- Repository: https://github.com/pnpm/npm-lifecycle
- Homepage: https://github.com/pnpm/npm-lifecycle#readme
- Issues: https://github.com/pnpm/npm-lifecycle/issues
- npm.io page: https://npm.io/package/@pnpm/npm-lifecycle

## Dependencies (7)

- [which](https://npm.io/package/which.md) ^4.0.0
- [node-gyp](https://npm.io/package/node-gyp.md) ^11.2.0
- [uid-number](https://npm.io/package/uid-number.md) 0.0.6
- [@pnpm/error](https://npm.io/package/@pnpm/error.md) ^1000.0.2
- [@pnpm/byline](https://npm.io/package/@pnpm/byline.md) ^1.0.0
- [@yarnpkg/fslib](https://npm.io/package/@yarnpkg/fslib.md) ^3.1.2
- [@yarnpkg/shell](https://npm.io/package/@yarnpkg/shell.md) 4.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1100.1.0 (latest) — 2026-08-27
- 2.0.0-1 (next) — 2022-02-21
- 1100.0.0 — 2026-06-14
- 1100.0.0-1 — 2026-03-28
- 1100.0.0-0 — 2026-03-27
- 1001.0.0 — 2025-09-04
- 1000.0.4 — 2025-04-26
- 1000.0.3 — 2025-04-23
- 1000.0.2 — 2025-03-02
- 1000.0.1 — 2024-12-19
- 1000.0.0 — 2024-12-11
- 3.0.4 — 2024-04-15
- 3.0.3 — 2024-04-15
- 3.0.2 — 2024-04-12
- 3.0.1 — 2024-02-12
- … 10 more at https://npm.io/package/@pnpm/npm-lifecycle/versions

## README

# @pnpm/npm-lifecycle

[`@pnpm/npm-lifecycle`](https://github.com/pnpm/npm-lifecycle) is a standalone library for
executing packages' lifecycle scripts. It is extracted from npm itself and
intended to be fully compatible with the way npm executes individual scripts.

## Install

`$ pnpm add @pnpm/npm-lifecycle`

## Table of Contents

* [Example](#example)
* [Features](#features)
* [Contributing](#contributing)
* [API](#api)
  * [`lifecycle`](#lifecycle)

### Example

```javascript
// idk yet
```

### Features

* something cool

### Contributing

The npm team enthusiastically welcomes contributions and project participation!
There's a bunch of things you can do if you want to contribute! The [Contributor
Guide](CONTRIBUTING.md) has all the information you need for everything from
reporting bugs to contributing entire new features. Please don't hesitate to
jump in if you'd like to, or even ask us questions if something isn't clear.

### API

#### <a name="lifecycle"></a> `> lifecycle(name, pkg, wd, [opts]) -> Promise`

##### Arguments

* `opts.stdio` - the [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio)
passed to the child process. `[0, 1, 2]` by default.
* `opts.runConcurrently` - *Boolean* - `false` by default. If `true`, lifecycle scripts may run concurrently.
* `opts.extraEnv` - *Record<string, string>* - add some extra env vars to the exec environment of the lifecycle script.
* `opts.onSpawn` - *Function* - called with each spawned lifecycle child process.

##### Example

```javascript
lifecycle()
```

## License

Artistic-2.0

---
_Source: https://npm.io/package/@pnpm/npm-lifecycle · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
