From e23c4af1cc4149d0567f8b15bbeba594685288c9 Mon Sep 17 00:00:00 2001 From: isaacs Date: Tue, 7 Jul 2020 10:20:06 -0700 Subject: 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. --- docs/content/cli-commands/npm-bugs.md | 9 +++++++-- docs/content/cli-commands/npm-docs.md | 12 ++++++++---- docs/content/cli-commands/npm-repo.md | 9 +++++++-- docs/content/using-npm/config.md | 9 +++++++-- 4 files changed, 29 insertions(+), 10 deletions(-) (limited to 'docs') 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 [] +npm bugs [ [ ...]] 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 [ [ ...]] -npm docs . -npm home [ [ ...]] -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 [] +npm repo [ [ ...]] ``` ### 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 -- cgit v1.2.3