nodemon —— Node服務自動重啓實時刷新

目錄

  • 起步
  • 使用

nodemon做用就是實時更新,不用每次都運行一個node <filename>node

起步

npm i -g nodemon

使用

nodemon <filename>

舉個例子:git

// 00.js
console.log("test")
nodemon .\00-parpare.js

# [nodemon] 2.0.4
# [nodemon] to restart at any time, enter `rs`
# [nodemon] watching path(s): *.*
# [nodemon] watching extensions: js,mjs,json
# [nodemon] starting `node .\00-parpare.js`
# test    ------>輸出結果

修改00.js,無需重啓github

console.log("test123")
# [nodemon] clean exit - waiting for changes before restart
# [nodemon] restarting due to changes...
# [nodemon] starting `node .\00-parpare.js`
# test123   ------>輸出結果
# [nodemon] clean exit - waiting for changes before restart
相關文章
相關標籤/搜索