# nodemon —— Node服务自动重启实时刷新

nodemon作用就是实时更新,不用每次都运行一个node <filename>

# 起步

npm i -g nodemon

# 使用

nodemon <filename>

举个例子:

// 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,无需重启

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
更新时间: 2021-02-25 00:05