server-watch
v1.0.8
Published
A minimal package to watch node js server files and restart the server when a file is changed
Downloads
17
Maintainers
Readme
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-watch
To install this package on a per-project basis run:
npm install server-watch
How 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.js
If 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.js
Setting up an sw.config.json
file
If you add an sw.config.json
to your root directory, you only need to run:
server-watch
Your 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