lighter-run
With lighter-run
, you can run the node application that's in your current
directory, and it will restart when files change.
Quick Start
- Install globally (using sudo if necessary).
npm install --global lighter-run
-
Ensure that the
"main"
property in yourpackage.json
points to your application's entry point file. -
Run!
lighter-run
Passing Arguments
To pass arguments to your entry point, just list them after a double-dash:
lighter-run -- ARG1 ARG2 ARG3
Running Other Files
If you'd like to run a file other than the one that's specified as "main"
in
your package.json
, then you can specify it as an argument to lighter-run
:
lighter-run index
NOTE: You can omit the ".js" extension just as you would with the node
executable.
Configuration
lighter-run
uses lighter-config
for its configuration. Just create a
"config/base.json"
file in your project, and add some options under a
property called "lighterRun"
. The following is an example of a configuration
which uses the default values:
minRestartDelay
Amount of time to wait before trying to restart (the first time).
maxRestartDelay
Maximum amount of time to wait before trying to restart, after failing many times.
restartDelayBackoff
Multiplier to be applied to the restart delay time after each failure.
cleanTime
Length of time that a process must be running before it's considered to have started cleanly.
ignore
File patterns in which changes should be ignored.
live
File patterns that can be live-reloaded instead of restarting the process.
watchDirs
Absolute paths for directories that should be watched. (Defaults to the current
working directory).