Typography

活版印字


  • Home
  • Archive
  • Categories
  • Tags
  •  

© 2020 alincode

Theme Typography by Makito

Proudly published with Hexo

更新 geoip lite module 的 IP 對應表

Posted at 2016-08-12 geoip 

安裝

npm install geoip-lite

使用

1
2
3
4
5
6
7
8
9
10
11
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 對照表

1
2
cd ./node_modules/geoip-lite
npm run-script updatedb

Share 

 Previous post: Promise map 並發 Next post: MySQL 設定遠端連線 

© 2020 alincode

Theme Typography by Makito

Proudly published with Hexo