diff --git a/docs/content/commands/npm-prefix.md b/docs/content/commands/npm-prefix.md index 6894cb5c9298c..9c33bb18901ef 100644 --- a/docs/content/commands/npm-prefix.md +++ b/docs/content/commands/npm-prefix.md @@ -12,13 +12,25 @@ npm prefix [-g] ### Description -Print the local prefix to standard out. This is the closest parent directory +Print the local prefix to standard output. This is the closest parent directory to contain a `package.json` file or `node_modules` directory, unless `-g` is also specified. If `-g` is specified, this will be the value of the global prefix. See [`npm config`](/commands/npm-config) for more detail. +### Example + +```bash +npm prefix +/usr/local/projects/foo +``` + +```bash +npm prefix -g +/usr/local +``` + ### See Also * [npm root](/commands/npm-root)