更新 geoip lite module 的 IP 對應表
Posted at 2016-08-12 geoip
安裝
npm install geoip-lite
使用
1234567891011
var geoip = require('geoip-lite');var ip = "207.97.227.239";var geo = geoip.lookup(ip);console.log(geo);{ range: [ 3479299040, 3479299071 ], country: 'US', region: 'CA', city: 'San Francisco', ll: [37.7484, -122.4156] }
定期更新 IP 對照表
12
cd ./node_modules/geoip-litenpm run-script updatedb
Previous post: Promise map 並發 Next post: MySQL 設定遠端連線