4 Detect if we were run as a result of `npm publish`. This is intended to allow you to
5 easily have prepublish lifecycle scripts that don't run when you run `npm install`.
8 $ npm install --save in-publish
9 in-publish@1.0.0 node_modules/in-publish
12 Then edit your package.json to have:
16 "prepublish": "in-publish && thing-I-dont-want-on-dev-install || in-install"
24 Then `thing-I-dont-want-on-dev-install` won't be run, but...
29 And `thing-I-dont-want-on-dev-install` will be run.
34 This detects that its running as a part of publish command in a terrible,
35 terrible way. NPM dumps out its config object blindly into the environment
36 prior to running commands. This includes the command line it was invoked
37 with. This module determines if its being run as a result of publish by
38 looking at that env var. This is not a part of the documented npm interface
39 and so it is not guarenteed to be stable.