Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@pnpm/npm-lifecycle

pnpm81.1kArtistic-2.01000.0.4

JavaScript package lifecycle hook runner

npm, lifecycle, hook, runner

readme

@pnpm/npm-lifecycle

@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

// 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 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

> lifecycle(name, pkg, wd, [opts]) -> Promise

Arguments
  • opts.stdio - the 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.
Example
lifecycle()

License

Artistic-2.0

changelog

Change Log

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

2.1.0 (2018-08-13)

Bug Fixes

  • windows: revert writing all possible cases of PATH variables (#22) (8fcaa21), closes #20

Features

2.0.3 (2018-05-16)

2.0.2 (2018-05-16)

Bug Fixes

  • hooks: run .hooks scripts even if package.json script is not present (#13) (67adc2d)
  • windows: Write to all possible cases of PATH variables (#17) (e4ecc54)

2.0.1 (2018-03-08)

Bug Fixes

  • log: Fix formatting of invalid wd warning (#12) (ced38f3)

2.0.0 (2017-11-17)

Features

  • node-gyp: use own node-gyp (ae94ed2)
  • nodeOptions: add "nodeOptions" option to set NODE_OPTIONS for child (#7) (2eb7a38)
  • stdio: add child process io options and default logging of piped stdout/err (#3) (7b8281a)

BREAKING CHANGES

  • node-gyp: Previously you had to bring your own node-gyp AND you had to provide access the way npm does, by having a bin dir with a node-gyp-bin in it.

Fixes: #4

1.0.3 (2017-09-01)

Bug Fixes

  • runCmd: add missing option to runCmd recursive queue call (1a69ce8)

1.0.2 (2017-08-17)

1.0.1 (2017-08-16)

Bug Fixes

  • license: fix up license documentation (a784ca0)

1.0.0 (2017-08-16)

Bug Fixes

Features

  • api: Extract from npm proper (#1) (27d9930)

BREAKING CHANGES

  • api: this is the initial implementation