{"_id":"200","_rev":"4-d6bbadb34cebc998106717c5c0710047","name":"200","description":"Ip location query.","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"200","version":"0.0.1","description":"Ip location query.","dependencies":{"debug":"0.8.0","iconv-lite":"0.2.11"},"devDependencies":{"autod":"*","benchmark":"*","contributors":"*","cov":"*","istanbul-harmony":"*","jshint":"*","mocha":"*","should":"3.2.0"},"main":"index","scripts":{"test":"make test"},"config":{"alicov":{"threshold":100}},"homepage":"https://github.com/leoner/iputil","repository":{"type":"git","url":"git@github.com:leoner/iputil.git"},"bugs":{"url":"https://github.com/leoner/iputil/issues"},"_id":"200@0.0.1","dist":{"shasum":"e1181dc04e28c913411aefc775157c67027d2b9f","tarball":"https://registry.npmjs.org/200/-/200-0.0.1.tgz","integrity":"sha512-3fXVH3UB46Bdqltxr3sFGEvne+rXycKuVmEGqCGoQUfiOL82jPHzNDC5Twa72cxyndWh+Ot072S608TI+r/KZg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH8XvW8cU1sx6TQb/ZLeS4eFio3kNd+sLg1a26bPLzAhAiAvSbOi2dgHocBJJQNx/hVh+1quNK2xfXTPPx/ycwQmbQ=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"kangpangpang","email":"kangpangpang@gmail.com"},"maintainers":[{"name":"kangpangpang","email":"kangpangpang@gmail.com"}]}},"readme":"iputil\n======\n\n查询指定 ip 所在地.\n### 支持的 IP 数据格式\n\n```\n10.5.18.0, 10.5.18.255, 中国, 福建, null, 中国福建省\n10.5.0.0, 10.5.255.255, 中国, 福建, 福州, 中国福建省\n1.0.0.0, 1.0.0.255, 澳大利亚, null, null, 澳大利亚\n1.0.1.0, 1.0.3.255, 中国, 福建, null, 中国福建省\n1.0.4.0, 1.0.7.255, 澳大利亚, null, null, 澳大利亚\n1.0.8.0, 1.0.15.255, 中国, 广东, null, 中国广东省\n```\n\n### 使用\n\n```\nvar IpUtil = require('iputil');\n\nipUtil = new IpUtil('ip-utf8.txt', 'utf8');\n\nipUtil.getIpInfo('1.12.0.0').country; // 中国\nipUtil.getIpInfo('1.12.0.0').province; // 北京\nipUtil.getIpInfo('1.12.0.0').city; // 北京   );\n\nipUtil_gbk = new IpUtil('ip-gbk.txt');\n\nipUtil_gbk.getIpInfo('1.12.0.0').country; // 中国\nipUtil_gbk.getIpInfo('1.12.0.0').province; // 北京\nipUtil_gbk.getIpInfo('1.12.0.0').city; // 北京 ;\n\n```\n\n### 注意\n用到了 es6 的生成器, 所以需要使用 node 0.11.x 以上的版本.\n\n### Benchmark\n\n```bash\n$ node benchmark.js\niniting iputil\ndone, use 9088 ms\niputil.getIpInfo(\"115.193.152.250\"): {\"startIp\":1942067200,\"endIp\":1942067455,\"country\":\"中国\",\"province\":\"浙江\",\"city\":\"杭州\",\"address\":\"中国浙江省杭州市萧山区\"}\niputil.getIpInfo(\"222.73.68.35\"): {\"startIp\":3729342720,\"endIp\":3729343999,\"country\":\"中国\",\"province\":\"上海\",\"city\":\"上海\",\"address\":\"中国上海市浦东区\"}\niputil.getIpInfo(\"220.191.113.36\"): {\"startIp\":3703533568,\"endIp\":3703534591,\"country\":\"中国\",\"province\":\"浙江\",\"city\":\"杭州\",\"address\":\"中国浙江省杭州市萧山区\"}\niputil.getIpInfo() one ip x 698,317 ops/sec ±2.01% (92 runs sampled)\nFastest is iputil.getIpInfo() one ip\n```\n","maintainers":[{"name":"kangpangpang","email":"kangpangpang@gmail.com"}],"time":{"modified":"2022-06-12T14:06:25.324Z","created":"2014-04-21T07:46:08.707Z","0.0.1":"2014-04-21T07:46:08.707Z"},"homepage":"https://github.com/leoner/iputil","repository":{"type":"git","url":"git@github.com:leoner/iputil.git"},"bugs":{"url":"https://github.com/leoner/iputil/issues"},"readmeFilename":"README.md"}