1

目录

  • 起步
  • 使用

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

顽皮的雪狐七七
787 声望74 粉丝

学习探索使我内心平静,