Keep a Node.js web server running as a background daemon that automatically restarts after crashes.
Watch a source directory for file changes and auto-restart a Node.js app on edits during development.
Define multiple Node.js apps in a JSON config file and start, stop, or restart them all with one command.
Cap how many times a crashed script is allowed to restart before giving up, and redirect its output to a log file.
Project is community-maintained, the original authors recommend pm2 or nodemon for new projects.
Forever is a command-line tool for Node.js that keeps a script running at all times. If the script crashes or exits, forever detects this and starts it again automatically. You install it once globally via npm, then use it to wrap any script you want to keep alive. The basic workflow is simple: instead of running "node app.js" directly, you run "forever start app.js". The process moves to the background as a daemon, and forever watches over it. If it dies, forever restarts it. You can see all running scripts with "forever list", stop them by name or ID, restart them, or tail their log files, all from the command line. Beyond simple restarts, the tool offers a range of options. You can cap how many times a script is allowed to restart before giving up, redirect its output and error streams to log files, watch the source directory for file changes and restart on edits, and control the minimum uptime a process must reach before forever stops treating it as a crash loop. Configuration can be passed as command-line flags or written into a JSON file, which also lets you define multiple apps to start together. The README notes that this project is now maintained by the community rather than by an active core team. For new projects, the authors themselves suggest looking at alternatives like pm2 or nodemon, which have more active maintenance and broader feature sets. Forever also exposes a programmatic API, though the README recommends installing the companion package forever-monitor for that use case rather than the main CLI package. The programmatic side is geared toward developers who want process-management behavior built into their own Node.js applications rather than managed from a terminal.
← foreversd on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.