1.1.1 • Published 6 years ago

@ssmr9dt/hotdeploy v1.1.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

hotdeploy

Hotdeploy can update and apply the file being read with require during execution.

hotdeployは実行中にrequireで読んでいるファイルを更新と適用が行えます。

Usage

npm i ssmr9dt/hotdeploy

Please reference test/example.js

const hotdeploy = require("@ssmr9dt/hotdeploy.js");
var commands = {};

hotdeploy(__dirname + "/server.d", function(key, module){
  console.log("Reload", key);
  commands[key] = module || null;
});

(function _Exec(){
  setTimeout(_Exec, 1000);
  
  for (var key in commands) {
    if (!!!commands[key] || typeof(commands[key]) !== "function") {
      continue;
    }
    commands[key]();
  }
})();
echo "module.exports = function(){console.log(\"execute red.js\")};" > server.d/red.js

Image

Gif

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago