UNPKG

ftp-srv-esm

Version:

Modern, extensible FTP server (daemon) for Node.js with ESM support. Based on ftp-srv.

9 lines (8 loc) 297 B
export async function findWanIp(url = 'https://checkip.amazonaws.com') { const response = await fetch(url); if (!response.ok) { throw new Error(`Unexpected response: ${response.status} ${response.statusText}`); } const wanIp = (await response.text()).trim(); return wanIp; }