Estoy buscando una manera de usar parámetros fuera de su función, escribí esto:
await checkrequest(checkoptions, async function (error, response, body) { await console.error('error:', error); // Print the error if one occurred await console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received await console.log('body:', body); var string; string = body.toString(); }); }while(string.includes("NotFound") == true)Pero el cuerpo en el while no se ve como ya declarado, también intenté poner el "var string" fuera de la función, pero nada, no toma el valor del cuerpo.