{"library":"node-ipinfo","title":"IPinfo Node.js Client Library","description":"The official Node.js client library for the IPinfo.io IP data API. This library allows developers to retrieve comprehensive details for IP addresses, including geolocation (city, region, country, postal code, lat/long), ASN details, company data, and carrier information. The current stable version is 4.4.0. Releases are typically driven by API changes or significant internal improvements, as seen with the v4.0.0 update. Key differentiators include direct integration with the IPinfo.io platform, support for both Core and Lite APIs, and comprehensive data fields beyond basic geolocation. It works with ES5, ES6+, and TypeScript environments, and requires an API token for usage.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install node-ipinfo"],"cli":null},"imports":["import { IPinfoWrapper } from 'node-ipinfo';","import { IPinfoLiteWrapper } from 'node-ipinfo';","import type { IPinfo } from 'node-ipinfo';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { IPinfoWrapper } from 'node-ipinfo';\n\nasync function getIpInfo() {\n  const token = process.env.IPINFO_TOKEN ?? ''; // Set your IPINFO_TOKEN environment variable\n  if (!token) {\n    console.error('IPINFO_TOKEN environment variable is not set.');\n    process.exit(1);\n  }\n\n  const ipinfoWrapper = new IPinfoWrapper(token);\n  const ipAddress = '8.8.8.8'; // Or process.argv[2] for CLI\n\n  try {\n    const ipinfo = await ipinfoWrapper.lookupIp(ipAddress);\n    console.log(`IP: ${ipinfo.ip}`);\n    console.log(`City: ${ipinfo.city}`);\n    console.log(`Country: ${ipinfo.country}`);\n    console.log(`Org: ${ipinfo.org}`);\n    console.log(`Location: ${ipinfo.loc}`);\n  } catch (error) {\n    console.error(`Failed to lookup IP ${ipAddress}:`, error);\n  }\n}\n\ngetIpInfo();","lang":"typescript","description":"This quickstart initializes the IPinfo client with an API token from an environment variable and performs a lookup for a specific IP address, printing key details.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}