简体   繁体   English

使用JavaScript / Node.js从ip地址获取两个字母的大陆代码

[英]Get two letter continent code from ip address with JavaScript/Node.js

I'm writing a JavaScript/Node.js application that needs to place items in a continent based on an IP address I receive. 我正在编写一个JavaScript / Node.js应用程序,它需要根据我收到的IP地址在大陆放置项目。 PHP has a geoip_continent_code_by_name function which does exactly what I want except, of course, it's in PHP. PHP有一个geoip_continent_code_by_name函数,它完全符合我的要求,当然,它是在PHP中。 Does anybody know of a JavaScript equivalent for this? 有人知道这个JavaScript的等价物吗? It doesn't need to do any fancy address to latitude/longitude or similar things. 它不需要对纬度/经度或类似的东西做任何花哨的地址。 It could be a standalone library, an NPM module, anything. 它可以是一个独立的库,一个NPM模块,任何东西。

The PHP function uses the MaxMind databases. PHP函数使用MaxMind数据库。 Maxmind also provide Node.js and Javascript libraries for their databases here Maxmind还在这里为他们的数据库提供Node.js和Javascript库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM