UNPKG

ip-to-hosting

Version:

This package allows you to check whether an IP address belongs to a hosting provider or not. In case the IP address can be successfully linked to a hosting provider (datacenter), this module will return the meta information for the hosting provider.

2 lines (1 loc) 186 B
function ipToHosting(t){return new Promise(function(n){fetch("https://api.ipapi.is/?q="+t).then(t=>t.json()).then(function(t){try{t&&t.datacenter&&n(t.datacenter)}catch(t){}n(null)})})}