I have an node app that runs as a cron job every few seconds:
var CronJob = require('cron').CronJob;
new CronJob('*/5 * * * * *', function(){
console.log('Here invoke a script called requestdata');
}, null, true, "America/Los_Angeles");
and I just want to call a script without invoking functions on it. So its not
requestdata.foo();
but just call requestdata in same directory. how is this done? If it was on command line I would just do:
node requestdata
but how do I do this inside another script?
exec(), simplyrequire()it, etc. There's plenty you could do, but what you do depends on your specific needs.