how to reload a module in node.js
snippet in javascript

how to reload a module in node.js

user927

delete require.cache[require.resolve('./path-of-file')];
require('./path-of-file');