Skip to content

Commit

Permalink
docs: update docs for npmrc and package-json (#7743)
Browse files Browse the repository at this point in the history
Updating Docs for 
`npmrc` 
- Updated example config, instead of `prefix` which can not be changed
for project, instead added `cache` which can be used for all three
config types project, user and global
 
 `package-json` 
- added alias example in package-json docs, which can be used to define
alias for a package

closes: #6839
closes: #7188
  • Loading branch information
milaninfy authored Aug 21, 2024
1 parent 2404c7e commit e674987
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/lib/content/configuring-npm/npmrc.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Environment variables can be replaced using `${VARIABLE_NAME}`. For
example:

```bash
prefix = ${HOME}/.npm-packages
cache = ${HOME}/.npm-packages
```

Each of these files is loaded, and config options are resolved in priority
Expand Down
4 changes: 3 additions & 1 deletion docs/lib/content/configuring-npm/package-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@ See [semver](https://github.com/npm/node-semver#versions) for more details about
* `tag` A specific version tagged and published as `tag` See [`npm
dist-tag`](/commands/npm-dist-tag)
* `path/path/path` See [Local Paths](#local-paths) below
* `npm:@scope/pkg@version` Custom alias for a pacakge See [`package-spec`](/using-npm/package-spec#aliases)

For example, these are all valid:

Expand All @@ -634,7 +635,8 @@ For example, these are all valid:
"two": "2.x",
"thr": "3.3.x",
"lat": "latest",
"dyl": "file:../dyl"
"dyl": "file:../dyl",
"kpg": "npm:[email protected]"
}
}
```
Expand Down

0 comments on commit e674987

Please sign in to comment.