I\'m writing a web app in Node. If I\'ve got some JS file db.js with a function init in it how could I call that function from the command line?
db.js
init
Simple, in the javascript file testfile.js:
module.exports.test = function () { console.log('hi'); }; this.test();
Running at the prompt:
node testfile.js