i am trying to get value for function in ping lite, my return is undefinied,
my code is
async TesteMyPing(request: Request, response: Response) {
var Ping = require('ping-lite'); // import ping-lite
var ping = new Ping('uol.com.br'); // website for ping
var test = ping.send(function (err: any, ms: any) {
return ms;
});
console.log(test) // return Undefinied
return response.status(200).json(teste); // response for client Undefinied
}
how get value for is variable in nodejs, to be work on the rest of the function body? ty,
How to prevent a token created with OAuth 2.0 from expiring?
Want to improve this question? Update the question so it's on-topic for Stack Overflow
I am trying to autoplay a youtube video in a popup 5 seconds after document load, unfortunately, it's not working:
Want to improve this question? Add details and clarify the problem by editing this post
I was trying to use a global variable in a React app for debugging purposes, and ran into some issues that made me realize that I don't understand how global variables in javascript works