Skip to content

a simple way to restart your app without actually restarting node.js

Notifications You must be signed in to change notification settings

soliton4/restartable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Description

makes it possible to restart your app without restarting the main node.js process itself.
restartable takes advantage of the node.js cluster module. When a node process is forked using the cluster module, all the sourcefiles are being read from disk, making a virtual restart of node.js possible.
It is recommended for development or maintainance work.
It has not been tested in combination with apps that actually use cluster.

Usage

require("restartable")(function(parRestartableObj){
  console.log("this code is restartable");
  setTimeout(function(){
    parRestartableObj.restart();
  }, 2000);
}, function(parRestartableObj){
  console.log("this code is not restartable");
  setTimeout(function(){
    parRestartableObj.restart();
  }, 8000);
});

License

BSD

About

a simple way to restart your app without actually restarting node.js

Resources

Stars

Watchers

Forks

Packages

No packages published