diff options
author | isaacs <i@izs.me> | 2020-07-07 20:20:06 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2020-07-08 03:20:29 +0300 |
commit | e23c4af1cc4149d0567f8b15bbeba594685288c9 (patch) | |
tree | b339a4a77da39c6e11042d436a5be53841dc9aa0 /docs | |
parent | 12779c8d75dd91af33d299e46c8e253bf0171102 (diff) |
rm fetch-package-metadata, refactor bugs/repo/docs
- remove the now-outdated 'fetch-package-metadata' module.
- refactor the `bugs`, `repo`, and `docs` commands for consistency.
- add unit tests for refactored commands and new util module.
- update `browser` config handling to honor `browser = false` in config
files, along with command line flag. (previously only cli config was
honored.)
- slight improvement to `open-url` output when browser not used.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/content/cli-commands/npm-bugs.md | 9 | ||||
-rw-r--r-- | docs/content/cli-commands/npm-docs.md | 12 | ||||
-rw-r--r-- | docs/content/cli-commands/npm-repo.md | 9 | ||||
-rw-r--r-- | docs/content/using-npm/config.md | 9 |
4 files changed, 29 insertions, 10 deletions
diff --git a/docs/content/cli-commands/npm-bugs.md b/docs/content/cli-commands/npm-bugs.md index 6e59f2bd1..1e7272cec 100644 --- a/docs/content/cli-commands/npm-bugs.md +++ b/docs/content/cli-commands/npm-bugs.md @@ -10,7 +10,7 @@ description: Bugs for a package in a web browser maybe ### Synopsis ```bash -npm bugs [<pkgname>] +npm bugs [<pkgname> [<pkgname> ...]] aliases: issues ``` @@ -27,10 +27,15 @@ a `package.json` in the current folder and use the `name` property. #### browser * Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` -* Type: String +* Type: String or Boolean The browser that is called by the `npm bugs` command to open websites. +Set to `false` to suppress browser behavior and instead print urls to +terminal. + +Set to `true` to use default system URL opener. + #### registry * Default: https://registry.npmjs.org/ diff --git a/docs/content/cli-commands/npm-docs.md b/docs/content/cli-commands/npm-docs.md index f157e200d..ffa5db5ac 100644 --- a/docs/content/cli-commands/npm-docs.md +++ b/docs/content/cli-commands/npm-docs.md @@ -12,9 +12,8 @@ description: Docs for a package in a web browser maybe ```bash npm docs [<pkgname> [<pkgname> ...]] -npm docs . -npm home [<pkgname> [<pkgname> ...]] -npm home . + +aliases: home ``` ### Description @@ -30,10 +29,15 @@ the current folder and use the `name` property. #### browser * Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` -* Type: String +* Type: String or Boolean The browser that is called by the `npm docs` command to open websites. +Set to `false` to suppress browser behavior and instead print urls to +terminal. + +Set to `true` to use default system URL opener. + #### registry * Default: https://registry.npmjs.org/ diff --git a/docs/content/cli-commands/npm-repo.md b/docs/content/cli-commands/npm-repo.md index 48021d9af..04544347c 100644 --- a/docs/content/cli-commands/npm-repo.md +++ b/docs/content/cli-commands/npm-repo.md @@ -11,7 +11,7 @@ description: Open package repository page in the browser ### Synopsis ```bash -npm repo [<pkg>] +npm repo [<pkgname> [<pkgname> ...]] ``` ### Description @@ -26,10 +26,15 @@ a `package.json` in the current folder and use the `name` property. #### browser * Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` -* Type: String +* Type: String or Boolean The browser that is called by the `npm repo` command to open websites. +Set to `false` to suppress browser behavior and instead print urls to +terminal. + +Set to `true` to use default system URL opener. + ### See Also * [npm docs](/cli-commands/docs) diff --git a/docs/content/using-npm/config.md b/docs/content/using-npm/config.md index 8aa149198..e444d5fb8 100644 --- a/docs/content/using-npm/config.md +++ b/docs/content/using-npm/config.md @@ -227,9 +227,14 @@ ostensibly Unix systems. #### browser * Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` -* Type: String +* Type: String or Boolean + +The browser that is called by npm commands to open websites. + +Set to `false` to suppress browser behavior and instead print urls to +terminal. -The browser that is called by the `npm docs` command to open websites. +Set to `true` to use default system URL opener. #### ca |