const { spawn } = require("child_process"); module.exports = async function getISP(ip_address) { return new Promise((resolve, reject) => { const task = spawn("whois", [ip_address]); let data = ""; task.stdout.on("data", (d) => { data += d.toString(); }); task.on("close", () => { resolve( data .split("\n") .filter((l) => l.includes("role:")) .join("|") ); }); task.on("error", () => reject()); }); };