bad-ip-blocklist
v5.1.2
Published
IP blocklists containing IPs of known bad actors and ranges likely belonging to data centers
Downloads
17
Readme
Bad IPs blocklist
IP blocklists containing IPs of known bad actors and ranges likely belonging to data centers.
The files are located in dist/
directory.
Building
To generate your own fresh blocklist run:
$ TOKEN={IP2LOCATION_DOWNLOAD_TOKEN} ./bin/build.sh
You can get your free token on https://lite.ip2location.com/.
Usage in node
Install dependencies and generate a DB
npm install
npm run buildDb
Run the example file:
node ./src/example.js`
// ./src/example.js
const IpInfo = require('./index');
console.time('init');
const ipInfo = new IpInfo('../dist/ipinfo.db');
console.timeEnd('init');
const ip = '93.201.96.204';
console.time('queries');
console.log('Datacenter:', ipInfo.isDatacenter(ip));
console.log('Blacklisted:', ipInfo.isBlacklisted(ip));
console.log('Country:', ipInfo.getCountry(ip));
console.timeEnd('queries');
Output:
init: 1.059ms
Datacenter: false
Blacklisted: true
Country: de
queries: 2.131ms
Used projects
Acknowledgments
- This product includes IP2Location LITE data available from http://www.ip2location.com.
- This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com.