LoginSignup
0
0

More than 5 years have passed since last update.

npm パッケージのページをブラウザで開く方法

Last updated at Posted at 2018-01-13

npm docs (npm home)

ホームページを開く。

$ npm docs # カレントディレクトリのパッケージ

$ npm docs eslint @types/node # 複数パッケージを指定可能

npm repo

リポジトリページを開く。

$ npm repo # カレントディレクトリのパッケージ

$ npm repo eslint # パッケージを1つだけ指定可能

npm bugs (npm issues)

issue ページを開く。

$ npm bugs # カレントディレクトリのパッケージ

$ npm bugs eslint # パッケージを1つだけ指定可能

以下の Bash 関数は不要で、npm 標準のコマンドのみで実現できた… :sweat_drops:

インストール

~/.bashrcnpm-open 関数を追加する。

~/.bashrc
# Usage: npm-open <package>
function npm-open() {
  [ -n "$1" ] && npm info "$1" homepage repository.url | head -1 | cut -d ' ' -f 3 | xargs open
}

使い方

$ npm-open eslint # homepage URL

$ npm-open @types/node # repository URL

Gist

Open NPM package's URL
https://gist.github.com/ybiquitous/31a7f54216cdd2a53d194efac93f7a29

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0