diff options
Diffstat (limited to 'deps/npm/docs/content/using-npm/scripts.md')
-rw-r--r--[-rwxr-xr-x] | deps/npm/docs/content/using-npm/scripts.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/deps/npm/docs/content/using-npm/scripts.md b/deps/npm/docs/content/using-npm/scripts.md index 6af5f7224d..6a2522fba4 100755..100644 --- a/deps/npm/docs/content/using-npm/scripts.md +++ b/deps/npm/docs/content/using-npm/scripts.md @@ -4,7 +4,7 @@ title: scripts description: How npm handles the "scripts" field --- -# scripts +# scripts(7) ## How npm handles the "scripts" field @@ -13,7 +13,7 @@ description: How npm handles the "scripts" field npm supports the "scripts" property of the package.json file, for the following scripts: -* **prepublish**: +* **prepublish** (_as of npm@5, `prepublish` is deprecated. Use `prepare` for build steps and `prepublishOnly` for upload-only._): Run BEFORE the package is packed and published, as well as on local `npm install` without any arguments. (See below) * **prepare**: @@ -59,7 +59,7 @@ following scripts: Additionally, arbitrary scripts can be executed by running `npm run-script <stage>`. *Pre* and *post* commands with matching names will be run for those as well (e.g. `premyscript`, `myscript`, -`postmyscript`). Scripts from dependencies can be run with +`postmyscript`). Scripts from dependencies can be run with `npm explore <pkg> -- npm run <stage>`. #### Prepublish and Prepare @@ -152,8 +152,8 @@ The package.json fields are tacked onto the `npm_package_` prefix. So, for instance, if you had `{"name":"foo", "version":"1.2.5"}` in your package.json file, then your package scripts would have the `npm_package_name` environment variable set to "foo", and the -`npm_package_version` set to "1.2.5". You can access these variables -in your code with `process.env.npm_package_name` and +`npm_package_version` set to "1.2.5". You can access these variables +in your code with `process.env.npm_package_name` and `process.env.npm_package_version`, and so on for other fields. #### configuration @@ -265,7 +265,7 @@ above. only will prevent some optional features, then it's better to just print a warning and exit successfully. * Try not to use scripts to do what npm can do for you. Read through - [`package.json`](/docs/configuring-npm/package-json) to see all the things that you can specify and enable + [`package.json`](/configuring-npm/package-json) to see all the things that you can specify and enable by simply describing your package appropriately. In general, this will lead to a more robust and consistent state. * Inspect the env to determine where to put things. For instance, if |