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 🙏

© 2025 – Pkg Stats / Ryan Hefner

zxkv-area

v1.0.0

Published

city data package

Readme

zxkv-aera

介绍

省-市-区、三级联动数据

安装

你可以使用 yarnnpmpnpm 等包管理工具进行安装; 安装方式如下:

yarn add zxkv-area

or

npm install zxkv-area

or

pnpm add zxkv-area

使用

处理生成的数据分为两类,分别是对 Object 对象类型和 Array 数组对象类型。

数据分类如下:

import {
	province_data,
	province_list,
	city_data,
	city_list,
	district_data,
	district_list,
	area_lv2,
	area_lv3
} from "zxkv-area";

Object 格式数据

| 方法 | 介绍 | | ------------- | ------ | | province_data | 省数据 | | city_data | 市数据 | | district_data | 区数据 |

「省 - level1」:province_data

{
	110000: "北京市",
	120000: "天津市",
	......
}

「市 - level2」:city_data

{
	110100: "北京市",
	......
}

「区 - level3」:district_data

{
	110101: "东城区",
	......
}

Array 格式数据

| 方法 | 介绍 | | ------------- | ------ | | province_list | 省数据 | | city_list | 市数据 | | district_list | 区数据 |

「省 - level1」:province_list

[
	{
		parent:"0",
		name:"北京市",
		code:"110000"
	},
	......
]

「市 - level2」:city_list

[
	{
		parent:"110000",
		name:"北京市",
		code:"110100"
	},
	......
]

「区 - level3」:district_list

[
	{
		parent:"110100",
		name:"东城区",
		code:"110101"
	},
	......
]
树形结构 格式数据

| 方法 | 介绍 | | -------- | ------------ | | area_lv2 | 省-市两级 | | area_lv3 | 省-市-区三级 |

「省 - 市」两级数据结构

[
	{
		parent:" 0",
		name:"北京市",
		code:"110000",
		children:[
			{
				parent:"110000",
				name:"北京市",
				code:"110100"
			},
			......
		]
	},
	......
]

「省 - 市 - 区」三级数据结构

[
	{
		parent:" 0",
		name:"北京市",
		code:"110000",
		children:[
			{
				parent:"110000",
				name:"北京市",
				code:"110100",
				children:[
					{
						parent:"110100",
						name:" 东城区",
						code:"110101"
					},
					......
				]
			},
			......
		]
	},
	......
]

最后

🍪 tips:初次产出,有好的建议和意见,邮件联系。

📮 email:[email protected]