npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@i-rs/area

v0.1.0

Published

中国·国家地名信息库 CLI 查询工具

Downloads

140

Readme

Area CLI

中国·国家地名信息库 CLI 查询工具

功能特性

  • 地名搜索 - 按名称搜索地名
  • 地名详情 - 获取地名详细信息
  • 同名区划统计 - 统计重名行政区划
  • 同名类别统计 - 按类别统计重名
  • 同音区划统计 - 同音字区划统计
  • 同音类别统计 - 同音字类别统计

安装

cargo build --release

或直接运行开发版本:

cargo run -- [OPTIONS] <COMMAND>

快速开始

搜索地名

# 搜索"故宫"
cargo run -- search 故宫

# 限定省份(北京)
cargo run -- search 故宫 -p 11

# 指定返回数量
cargo run -- search 故宫 -s 20

查看地名详情

cargo run -- detail <id>

输出格式

支持 JSON(默认)和 Table 两种输出格式:

# JSON 输出(默认)
cargo run -- search 故宫

# Table 输出
cargo run -- -o table search 故宫

全局选项

| 选项 | 说明 | |------|------| | -o, --output <FORMAT> | 输出格式: jsontable(默认: json) | | --no-cache | 跳过缓存,强制请求 API | | -h, --help | 显示帮助信息 | | -V, --version | 显示版本信息 |

数据缓存

本工具使用 SQLite 本地缓存查询结果,缓存有效期为 24 小时。

  • 缓存路径: ~/.cache/.area_cache.db
  • 使用 --no-cache 可跳过缓存

项目结构

area/
├── src/
│   └── main.rs          # 主程序
├── Cargo.toml           # 依赖配置
├── docs/
│   ├── usage.md         # 详细使用文档
│   └── test.md         # 测试文档
└── README.md

依赖

数据来源

本工具使用民政部提供的 中国·国家地名信息库 API 接口。

坐标系: 2000国家大地坐标系(CGCS2000)