1.0.8 • Published 3 years ago
server-watch v1.0.8
Server Watch
A feather-light package that watches and actively reloads node js server instances
Installation
To install this package run:
npm install -g server-watchTo install this package on a per-project basis run:
npm install server-watchHow to use
There are two ways to run server-watch
CLI run with arguments
If you installed the package globally, just run:
server-watch index.jsIf you installed the package for just a specific project, then you need to append the npx command to it. Like this:
npx server-watch index.jsSetting up an sw.config.json file
If you add an sw.config.json to your root directory, you only need to run:
server-watchYour configuration in your config file sets the required options for watching the server.
Basic configuration
{
"exec": "node .",
"ignore": [".git", "node_modules"]
}Parameters:
required: exec - This is your exectuion script
optional: ignore - This is an array of paths to ignore when waching the server