So I have a file called 'myinternet_utils.js' and the following function:
exports.hasInternet = function () {
require('dns').lookupService('8.8.8.8', 53, function (err, hostname, service) {
return hostname;
});
};
I also have a file called 'server.js', where I have this piece of code:
var ieUtils_ = require('./myinternet_utils.js');
console.log( ieUtils_.hasInternet() );
The 'console.log' prints 'undefined'.
Why am I not getting the output of the function hasInternet?