lighter-run

1.2.1 • Public • Published

lighter-run

Chat Version Downloads Build Coverage Style

With lighter-run, you can run the node application that's in your current directory, and it will restart when files change.

Quick Start

  1. Install globally (using sudo if necessary).
npm install --global lighter-run
  1. Ensure that the "main" property in your package.json points to your application's entry point file.

  2. 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:

{
  "lighterRun": {
    "minRestartDelay": 500,
    "maxRestartDelay": 5000,
    "restartDelayBackoff": 2,
    "cleanTime": 2000,
    "ignore": [
      ".DS_Store",
      ".cache",
      ".git",
      ".idea",
      ".project",
      "coverage",
      "data",
      "log"
    ],
    "live": [
      "public",
      "scripts",
      "styles",
      "views"
    ],
    "watchDirs": null
  }
}

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).

More on lighter-run...

Package Sidebar

Install

npm i lighter-run

Weekly Downloads

10

Version

1.2.1

License

MIT

Last publish

Collaborators

  • zerious