@ip2geo/sdk
v0.0.2
Published
Programmatically convert IP's into GEO location data.
Maintainers
Keywords
Readme
Intro to the Npm Package
This package provides a lightweight, type-safe way to integrate Ip2Geo. Blazingly fast and works with Node, Bun, and Deno out of the box.
Installing
npm i @ip2geo/sdk@latestInitializing
import { Init } from '@ip2geo/sdk'
import { Env } from '@/data'
await Init(Env.IP2GEO_API_KEY)Using
import { ConvertIP, ConvertIPs } from '@ip2geo/sdk'
const convertedIp = await ConvertIP({
ip: '8.8.8.8'
})
const convertedIps = await ConvertIPs({
ips: [
'8.8.8.8',
'1.1.1.1',
'9.9.9.9',
'64.6.64.6'
]
})
// {
// success: boolean
// code: number
// message: string
// data: Ip | null
// _req: {
// reqId: string | null
// resTime: number
// }
// }
// {
// message: string
// code: number
// sucess: boolean
// data: [
// {
// ip: string
// conversion: Ip | null
// }
// ],
// _req: {
// reqId: string | null
// resTime: number
// }
// }