kinode is dependency injection to register module to global access,
you can load each given module from kraken.config.json.
https://github.com/restuwahyu13/kraken-node#kraken-node
// horn.js
module.exports = function () {
return {
honk: function () {
console.log("beep!");
}
};
};
// car.js
module.exports = function (horn) {
return {
honkHorn: function () {
horn.honk();
}
};
};
// index.js
var horn = require("./horn")();
var car = require("./car")(horn);
car.honkHorn();