← 返回命令列表

Linux command

npm-repo 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Open the repository for a package

npm repo [package-name]

Open the repository for the current project

npm repo

Open repositories for multiple packages

npm repo [package1] [package2]

Print the repository URL without opening a browser

npm repo [package-name] --no-browser

说明

npm repo guesses the repository URL for a package from the `repository` field in its `package.json`, then opens it in the configured browser. If no package name is supplied, it reads from the `package.json` in the current directory. The browser used can be overridden with the `--browser` config option, or set globally via `npm config set browser program`. Passing `--no-browser` suppresses the browser and prints the URL instead.

参数

--browser _BROWSER_
Browser to open the URL with. Defaults to the system default (`open` on macOS, `start` on Windows, `xdg-open` on Linux).
--no-browser
Print the repository URL to stdout instead of opening a browser.
--help
Display help information.

FAQ

What is the npm-repo command used for?

npm repo guesses the repository URL for a package from the `repository` field in its `package.json`, then opens it in the configured browser. If no package name is supplied, it reads from the `package.json` in the current directory. The browser used can be overridden with the `--browser` config option, or set globally via `npm config set browser program`. Passing `--no-browser` suppresses the browser and prints the URL instead.

How do I run a basic npm-repo example?

Run `npm repo [package-name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --browser _BROWSER_ do in npm-repo?

Browser to open the URL with. Defaults to the system default (`open` on macOS, `start` on Windows, `xdg-open` on Linux).