🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@yuo/ip2region

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yuo/ip2region

@yuo/ip2region

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
3
-84.21%
Maintainers
2
Weekly downloads
 
Created
Source

@yuo/ip2region

特点简介

  • 📚 仅ipv4, 精确匹配国内省市区 > 99.999%
  • ⚡️ 50w~80w qps, $10^{-6}$ 秒级查询
  • 🍉 3.9MB, 短小精悍
  • ⛑ 内存数据库, 安全高并发

继续完善

每隔一段时间, 会有更新 城市IP段落

// ip.txt
223.255.253.0|223.255.253.255|贵州|贵阳|电信

// ip.city.txt, ./data/citycode.ts 映射
223.255.253.0|223.255.253.255|25|0|电信

使用方法

npm i @yuo/ip2region
import IpReader from '@yuo/ip2region';

// { pid: 1, cid: 0, zone: 'z1', province: '北京', city: '北京', ips: '阿里云' }
IpReader('39.107.84.26');

服务区域划分

IpReader(ip).zone 描述的区域

区域划分

Keywords

ip2region

FAQs

Package last updated on 01 Jul 2022

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