项目作者: 0x0a0d

项目描述 :
IP2Location NodeJS ES6, fork & rewrite sthing from IP2Location-NodeJS package
高级语言: JavaScript
项目地址: git://github.com/0x0a0d/ip2location-es6.git
创建时间: 2018-01-25T04:29:30Z
项目社区:https://github.com/0x0a0d/ip2location-es6

开源协议:

下载


IP2Location ES6 Module

Install

npm install ip2location-es6

Response Data

  1. "ip": "?",
  2. "ip_no": "?",
  3. "country_short": "?",
  4. "country_long": "?",
  5. "region": "?",
  6. "city": "?",
  7. "isp": "?",
  8. "latitude": "?",
  9. "longitude": "?",
  10. "domain": "?",
  11. "zipcode": "?",
  12. "timezone": "?",
  13. "netspeed": "?",
  14. "iddcode": "?",
  15. "areacode": "?",
  16. "weatherstationcode": "?",
  17. "weatherstationname": "?",
  18. "mcc": "?",
  19. "mnc": "?",
  20. "mobilebrand": "?",
  21. "elevation": "?",
  22. "usagetype": "?",
  23. "status": "?"

Function

  1. IP2Location_query(my_ip, ip_type, data)
  2. IP2Location_get_all(my_ip)
  3. IP2Location_get_areacode(my_ip)
  4. IP2Location_get_city(my_ip)
  5. IP2Location_get_country_long(my_ip)
  6. IP2Location_get_country_short(my_ip)
  7. IP2Location_get_domain(my_ip)
  8. IP2Location_get_elevation(my_ip)
  9. IP2Location_get_iddcode(my_ip)
  10. IP2Location_get_isp(my_ip)
  11. IP2Location_get_latitude(my_ip)
  12. IP2Location_get_longitude(my_ip)
  13. IP2Location_get_mcc(my_ip)
  14. IP2Location_get_mnc(my_ip)
  15. IP2Location_get_mobilebrand(my_ip)
  16. IP2Location_get_netspeed(my_ip)
  17. IP2Location_get_region(my_ip)
  18. IP2Location_get_timezone(my_ip)
  19. IP2Location_get_usagetype(my_ip)
  20. IP2Location_get_weatherstationcode(my_ip)
  21. IP2Location_get_weatherstationname(my_ip)
  22. IP2Location_get_zipcode(my_ip)

Usage demo

  1. const IP2Location = require('ip2location-es6');
  2. let ip2loc = new IP2Location(process.env.DB_IP2LOCATION_BIN_PATH);
  3. let result = ip2loc.IP2Location_get_all('8.8.8.8');
  4. console.log(result);