New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

ip-geo-zone

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ip-geo-zone

Simple library for determining country and timezone from IP address

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

ip-geo-zone

⚠️ Maintenance Notice: This project is provided as-is and is unlikely to receive updates.

Simple library for determining country and timezone from IP address using embedded country and timezone data.

Installation

npm install ip-geo-zone

Usage

import { findCountryByIp, findTimezonesByCountry, aton4 } from 'ip-geo-zone'

// Get country code from IP
const country = findCountryByIp('8.8.8.8')
console.log(country) // 'US'

// Get timezones for country
const timezones = findTimezonesByCountry('US')
console.log(timezones) // ['America/New_York', 'America/Los_Angeles', ...]

// Convert IP to numeric representation
const numeric = aton4('192.168.1.1')
console.log(numeric) // 3232235777

API

findCountryByIp(ipAddress: string): string | null

Returns country code (e.g., 'US') for the given IP address, or null if not found.

findTimezonesByCountry(countryCode: string): string[] | null

Returns array of timezone names for the given country code, or null if not found.

aton4(ipAddress: string): number

Converts IPv4 address string to numeric representation.

License

ISC

Keywords

ip

FAQs

Package last updated on 07 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts