LoginSignup
81
54

More than 5 years have passed since last update.

nodemonとは?

Last updated at Posted at 2018-11-27

メモ残しておきます

Koa.jsのチュートリアルを進めていると序盤でnodemonという見慣れないツールが出てきたのでメモを残しておきます。

nodemonとは?

ソースを監視して、自動でサーバーを再起動してくれるツール。
nodeの代わりにnodemonを使ってコードを走らせると、コードの変更時にプロセスが自動で再起動する。
ターミナルに以下を打てばインストールできる。

// nodemonのインストール
$ npm install -g nodemon

特徴

  • アプリケーションの自動再起動
  • 監視のためにファイルの拡張子を検出
  • node&coffeescriptがデフォのサポート。しかし、実行可能はファイルであれば走らせる事ができる。
  • 特定のファイルやディレクトリを無視する
  • 特定のディレクトリを監視する
  • サーバーアプリケーションまたは1回のユーティリティとREPLを実行
  • nodeのアプリでは必須
  • オープンソースであり、githubを利用可能

実際に変更があると。

[nodemon] starting `node app.js`
[nodemon] restarting due to changes...
[nodemon] starting `node app.js`

実際にファイルの変更があると、↑こんな感じで自動で再起動してくれる。

参考

81
54
1

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
81
54