1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Node.jsのCLIツールでURLを既定のブラウザで開く

Last updated at Posted at 2020-06-19

open パッケージを使用すると、クロスプラットフォームでその辺の処理をよしなにやってくれる。
実行時にHTTPサーバを立てたり、ライセンスなどを表示したりするようなCLIツールで便利かもしれない。

Install

yarn add open

Usage

非常にシンプル。

const open = require('open');

open('https://qiita.com/');

async/await を使用した実用的な例などは README を確認されたい。

なお、従来はopnという名称だったものがrenameされたらしい。

1
4
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
1
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?