watch_reapp
Version:
Restarts your nodejs app when you save a file in your specified directory.
15 lines • 912 B
JavaScript
//MODIFICATIONS IN THIS FILE WILL NOT BE UPDATED AUTOMATICALLY
//create a config object
const config = {
dir :'./',//this directory is the starting point for all sub-folders and files scanned
watch_ext : ['.js','.html', '.css', '.json'], //file extensions to watch
ignore_dirs : ['./node_modules/', './.vscode/', './MONGODATABASE/'], //directories to ignore,
ignore_dirs_containing : ['ZDEP_'], //wildcard strings directory
ignore_files : ['./ignore_file.js'], //files to ignore,
log : true, //define log directory default log dir will be "./LOGS/" if log_dir is not supplied
log_dir : './LOGS/' //bare in mind that this folder will be added to the ignore_dirs list
}
//require watch_reapp module
const watch_reapp = require('./watch_reapp')
//run module, with path to app you wish to run and add the config object as second parameter
watch_reapp('./_TEST.js', config)