LoginSignup
3
3

More than 5 years have passed since last update.

process.titleを変えて、psコマンドの表示名を変える

Posted at

Nodeのprocessパッケージにtitleというプロパティがある

process.title - Node.js v6.5.0 Documentation

titleに任意の値をセットすることで、psコマンドでの表示名を変えることができる。

参考:【ps・kill】実行中のプロセス表示と強制終了

// hoge.js
process.title = 'hoge process';

// + なんらかのサーバを立てる処理
$ ps

  PID TTY           TIME CMD
29384 ttys000    0:02.40 hoge process

PIDは適当

3
3
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
3
3