Initial commit
[yaffs-website] / node_modules / in-publish / README.md~
1 in-publish
2 ==========
3
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`.
6
7 ```
8 $ npm install --save in-publish
9 in-publish@1.0.0 node_modules/in-publish
10 ```
11
12 Then edit your package.json to have:
13
14 ```json
15   "scripts": {
16     "prepublish": "in-publish && thing-I-dont-want-on-dev-install || in-install"
17   }
18 ```
19
20 Now when you run:
21 ```
22 $ npm install
23 ```
24 Then `thing-I-dont-want-on-dev-install` won't be run, but...
25
26 ```
27 $ npm publish
28 ```
29 And `thing-I-dont-want-on-dev-install` will be run.
30
31 Caveat Emptor
32 =============
33
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. 
40