Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-ipinfo

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ipinfo - npm Package Compare versions

Comparing version 3.5.1 to 3.5.2

2

package.json
{
"name": "node-ipinfo",
"version": "3.5.1",
"version": "3.5.2",
"description": "Official Node client library for IPinfo",

@@ -5,0 +5,0 @@ "main": "dist/src/index.js",

@@ -169,9 +169,6 @@ # [<img src="https://ipinfo.io/static/ipinfo-small.svg" alt="IPinfo" width="24"/>](https://ipinfo.io/) IPinfo NodeJS Client Library

### Country Name Lookup
### Internationalization
`response.country` will return the country name, whereas `response.countryCode` can be used to fetch the country code.
When looking up an IP address, the response object includes `response.country` will return the country name, `response.countryCode` can be used to fetch the country code, Additionally `response.isEU` will return `true` if the country is a member of the European Union (EU), `response.countryFlag` will return the emoji and Unicode of the country's flag, `response.countryFlagURL` will return a public link to the country's flag image as an SVG which can be used anywhere, `response.countryCurrency` will return the code and symbol of the country's currency and `response.continent` will return the continent of the IP. It is possible to return the country name in other languages, change the EU countries, countries flags, countries currencies, and continents by setting the `countries`, `euCountries`, `countriesFlags`, `countriesCurrencies` and `continents` settings when creating the IPinfo object.
Additionally `response.isEU` will return `true` if the country is a member of the European Union (EU), `response.countryFlag`
will return the emoji and Unicode of the country's flag, `response.countryFlagURL` will return a public link to the country's flag image as an SVG which can be used anywhere, `response.countryCurrency` will return the code and symbol of the country's currency and `response.continent` will return the continent of the IP.
##### TypeScript

@@ -182,4 +179,44 @@

const ipinfoWrapper = new IPinfoWrapper("MY_TOKEN");
const countries = {
"US": "United States",
"FR": "France",
"BD": "Bangladesh",
...
}
const countriesFlags = {
"US": {"emoji": "🇺🇸","unicode": "U+1F1FA U+1F1F8"},
"AD": {"emoji": "🇦🇩", "unicode": "U+1F1E6 U+1F1E9"},
"AE": {"emoji": "🇦🇪", "unicode": "U+1F1E6 U+1F1EA"},
...
}
const countriesCurrencies = {
"US" : { "code": "USD" ,"symbol": "$"},
"AD": {"code": "EUR", "symbol": "€"},
"AE": {"code": "AED", "symbol": "د.إ"},
...
}
const continents = {
"US": {"code": "NA", "name": "North America"},
"BD": {"code": "AS", "name": "Asia"},
"BE": {"code": "EU", "name": "Europe"},
...
}
const euCountries = ["FR","ES","BE", ...]
const ipinfoWrapper = new IPinfoWrapper(
"MY_TOKEN",
undefined,
undefined,
{
countries: countries,
countriesFlags: countriesFlags,
countriesCurrencies: countriesCurrencies,
...
}
);
ipinfoWrapper.lookupIp("1.1.1.1").then((response: IPinfo) => {

@@ -214,4 +251,44 @@ // country code, e.g. 'US'

const ipinfo = new IPinfoWrapper("MY_TOKEN");
const countries = {
"US": "United States",
"FR": "France",
"BD": "Bangladesh",
...
}
const countriesFlags = {
"US": {"emoji": "🇺🇸","unicode": "U+1F1FA U+1F1F8"},
"AD": {"emoji": "🇦🇩", "unicode": "U+1F1E6 U+1F1E9"},
"AE": {"emoji": "🇦🇪", "unicode": "U+1F1E6 U+1F1EA"},
...
}
const countriesCurrencies = {
"US" : { "code": "USD" ,"symbol": "$"},
"AD": {"code": "EUR", "symbol": "€"},
"AE": {"code": "AED", "symbol": "د.إ"},
...
}
const continents = {
"US": {"code": "NA", "name": "North America"},
"BD": {"code": "AS", "name": "Asia"},
"BE": {"code": "EU", "name": "Europe"},
...
}
const euCountries = ["FR","ES","BE", ...]
const ipinfo = new IPinfoWrapper(
"MY_TOKEN",
undefined,
undefined,
{
countries: countries,
countriesFlags: countriesFlags,
countriesCurrencies: countriesCurrencies,
...
}
);
ipinfo.lookupIp("1.1.1.1").then((response) => {

@@ -218,0 +295,0 @@ // country code, e.g. 'US'

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc