2018-03-18 23:02:34 +02:00
2018-03-18 23:02:34 +02:00
2018-03-18 22:43:02 +02:00
2018-03-18 22:30:28 +02:00
2018-03-18 22:30:28 +02:00
2018-03-18 22:30:28 +02:00
2018-03-18 22:30:28 +02:00
2018-03-18 22:30:28 +02:00
2018-03-18 22:30:28 +02:00
2018-03-18 22:30:28 +02:00
2018-03-18 22:50:28 +02:00
2018-03-18 22:59:30 +02:00
2018-03-18 22:30:28 +02:00
2018-03-18 22:30:28 +02:00
2018-03-18 22:30:28 +02:00
2018-03-18 22:30:28 +02:00

@pnpm/lifecycle

Package lifecycle hook runner

npm version Build Status

Installation

npm i -S @pnpm/logger @pnpm/lifecycle

Usage

import runLifecycleHook, {runPostinstallHooks} from '@pnpm/lifecycle'

const targetPkgRoot = path.resolve('node_modules/target-pkg')
const pkg = require(path.join(targetPkgRoot, 'package.json'))

// Run a specific hook
await runLifecycleHook('preinstall', pkg, {
  pkgId: 'target-pkg/1.0.0',
  pkgRoot: targetPkgRoot,
  rawNpmConfig: {},
  rootNodeModulesDir: path.resolve('node_modules'),
  unsafePerm: true,
})

// Run all install hooks
await runPostinstallHooks({
  pkgId: 'target-pkg/1.0.0',
  pkgRoot: targetPkgRoot,
  rawNpmConfig: {},
  rootNodeModulesDir: path.resolve('node_modules'),
  unsafePerm: true,
})

API

runLifecycleHook(stage, packageJson, opts): Promise<void>

runPostinstallHooks(opts): Promise<void>

License

MIT © Zoltan Kochan

Description
No description provided
Readme MIT 297 MiB
Languages
TypeScript 98.8%
JavaScript 0.8%
Shell 0.4%