nodemon通过配置文件监视

标签:ref   cal   current   blob   tar   配置文件   star   oca   slice   

https://github.com/remy/nodemon#config-files

https://github.com/remy/nodemon/blob/master/doc/sample-nodemon.md

{
  "watch": ["src"],
  "ext": "html,vue,js,scss,css",
   "events": {
    "start": "node printdate.js start",
	"restart": "node printdate.js restart"
  }
}

 

printdate.js

//console.log(process.argv);
var myArgs = process.argv.slice(2);
//console.log(‘myArgs: ‘, myArgs);

const dateTime = require(‘date-time‘);
var currentTime = dateTime({local: true, showTimeZone: true, showMilliseconds: true});
console.log(`${myArgs[0]} at ${currentTime}`)

 

nodemon通过配置文件监视

标签:ref   cal   current   blob   tar   配置文件   star   oca   slice   

原文地址:https://www.cnblogs.com/chucklu/p/14180189.html

版权声明:完美者 发表于 2020-12-29 11:30:58。
转载请注明:nodemon通过配置文件监视 | 完美导航

暂无评论

暂无评论...