さようなら、ノデモン!

Feb 03 2023
私は nodemon が大好きです 、過去 6 年間、Node.js プロジェクトのほぼすべてでそれを使用していましたが、Node.js のリリースに伴い使用されました。

私は nodemon が大好きです 、過去 6 年間、ほぼすべての Node.js プロジェクトでこれを使用していましたが、Node.js 18 のリリースにより、必要なくなりました。

したがって、nodemon が何なのかわからない場合は、公式 Web サイトによると次のようになります。

「Nodemon は約 300 万のプロジェクトに依存するユーティリティで、ソース内の変更を監視し、サーバーを自動的に再起動します。開発に最適です。」(nodemon.io、2023)。

言い換えると、これは最初にプロジェクトの package.json ファイルまたはグローバルにインストールし、プロジェクト ファイルに変更を加えたときにサーバーを自動的に再起動するために使用する必要があるツールです。

例:

npm install -g nodemon #install it globally
npm install -D nodemon #install it locally (dev dependency)

nodemon server.js localhost 8080 #then to run your local dev server

#watches entry point file and any required imported modules
node --watch server.js

#specify which paths to watch, turns off watching of required 
#of imported modules (only on Windows, MacOS, ) 
node --watch-path=./src --watch-path=./tests index.js

#disables clearing console output when restarted
node --watch --watch-preserve-output server.js

参考文献:

github.com。2023.Node.js 18 変更ログ

ノードモン.io。2023年。

Nodejs.org。2023. Node.js v18.14.0 ドキュメント