How to use the @pnpm/lifecycle.runPostinstallHooks function in @pnpm/lifecycle

To help you get started, we’ve selected a few @pnpm/lifecycle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pnpm / pnpm / packages / build-modules / src / index.ts View on Github external
opts: {
    extraBinPaths?: string[],
    lockfileDir: string,
    optional: boolean,
    rawConfig: object,
    rootNodeModulesDir: string,
    sideEffectsCacheWrite: boolean,
    storeController: StoreController,
    unsafePerm: boolean,
    warn: (message: string) => void,
  }
) {
  const depNode = depGraph[depPath]
  try {
    await linkBinsOfDependencies(depNode, depGraph, opts)
    const hasSideEffects = await runPostinstallHooks({
      depPath,
      extraBinPaths: opts.extraBinPaths,
      optional: depNode.optional,
      pkgRoot: depNode.peripheralLocation,
      prepare: depNode.prepare,
      rawConfig: opts.rawConfig,
      rootNodeModulesDir: opts.rootNodeModulesDir,
      unsafePerm: opts.unsafePerm || false,
    })
    if (hasSideEffects && opts.sideEffectsCacheWrite) {
      try {
        await opts.storeController.upload(depNode.peripheralLocation, {
          engine: ENGINE_NAME,
          packageId: depNode.packageId,
        })
      } catch (err) {

@pnpm/lifecycle

Package lifecycle hook runner

MIT
Latest version published 1 month ago

Package Health Score

57 / 100
Full package analysis