isaacs/npm — pull request #3053 by paulmillr (2013-01-13 12:14:31+00:00)
Title: Make postpublish script to be run on cwd.

1. Having `publish` and `postpublish` identical is not very cool.
2. Having both of them executed on CACHED directory is absolutely not cool and useless.

Use case: CoffeeScript compilation.

1. I don’t want to store CoffeeScript-compiled JS output in repository.
2. I want compiled js to be published on NPM (with `prepublish` script).
3. I want users of git (pre-release) version of my package to be able to have coffeescript automatically compiled even though I don’t want to store coffee output in repo.
4. I don’t want `postinstall` to be executed for npm users because it’s buggy and stuff.

How:

1. `npm prepublish`: compile coffee, remove `scripts.postinstall` from `package.json`.
2. `npm postpublish`: bring back `scripts.postinstall` to `package.json`.
3. `npm postinstall`: compile coffee (only done for git users).

Used in https://github.com/paulmillr/chokidar.