Skip to content

Instantly share code, notes, and snippets.

@wraithgar
Created February 18, 2021 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wraithgar/152d207f761c331bc8dfe2a27792d291 to your computer and use it in GitHub Desktop.
Save wraithgar/152d207f761c331bc8dfe2a27792d291 to your computer and use it in GitHub Desktop.
npm7 lifecycle scripts notes
npm event lifecycle
cache add
- prepare (pacote.tarball.stream @npmcli/run-script)
ci
- preinstall (@npmcli/run-script)
- install (@npmcli/run-script)
- postinstall (@npmcli/run-script)
- prepublish (@npmcli/run-script)
- preprepare (@npmcli/run-script)
- prepare (@npmcli/run-script)
- postprepare (@npmcli/run-script)
diff
- prepare (libnpmdiff pacote.tarball @npmcli/run-script) (output suppressed)
exec
- npx
explore
- _explore
install (or install <package-name> -g)
- preinstall (@npmcli/run-script)
- install (@npmcli/run-script)
- postinstall (@npmcli/run-script)
- prepublish (@npmcli/run-script)
- preprepare (@npmcli/run-script)
- prepare (@npmcli/run-script)
- postprepare (@npmcli/run-script)
pack
- prepack (libnpmpack @npmcli/run-script)
- prepare (libnpmpack pacote.tarball @npmcli/run-script) (output suppressed)
- postpack (libnpmpack @npmcli/run-script)
publish
- prepublishOnly (@npmcli/run-script)
- prepack (libnpmpack @npmcli/run-script)
- prepare (libnpmpack pacote.tarball @npmcli/run-script) (output suppressed, not during dry-run)
- postpack (libnpmpack @npmcli/run-script)
- publish (@npmcli/run-script)
- postpublish (@npmcli/run-script)
restart
- restart (lifecycle-cmd)
run
- <user defined> (@npmcli/run-script)
stop
- stop (lifecycle-cmd)
start
- start (lifecycle-cmd)
test
- test (lifecycle-cmd)
version
- preversion (libnpmversion @npmcli/run-script)
- version (libnpmversion @npmcli/run-script)
- postversion (libnpmversion @npmcli/run-script)
prepare is also potentially run during:
- update
- link
- uninstall <package-name>
- prune
- install <package-name>
TODO
- prepare (arborist.build-idea-tree pacote.extract @npmcli/run-script) (output suppressed)
- prepare (arborist.reify pacote.extract @npmcli/run-script) (output suppressed)
- prepare and foregroundScripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment