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 🙏

© 2024 – Pkg Stats / Ryan Hefner

sfs-area-code

v1.0.4

Published

let's easy get china area

Downloads

18

Readme

sfs-area-code

中国省市区Json文件

对应的KEY是邮编地址。 前两位是省/直辖市,第三四位是市,四五位是区。

NPM安装: npm install sfs-area-code

或yarn:

yarn add sfs-area-code

使用示例:

import TEST from 'sfs-china-area'



// 获取所有省
const province = TEST.getList('province')
//返回 [{name:'北京',code:'110000'}]

// 获取所有城市 
// 例如获取北京 110000 
// 上一级代码会返回这个邮编code
const city = TEST.getList('city','110000')

// 获取所有区
const county = TEST.getList('county','110101')

//不筛选直接获取所有数据
TEST.province //省
TEST.city //市
TEST.county //区

数据示例:

'110000': '北京市'
'110200': '县'
'110101': '东城区',
'110102': '西城区',
'110105': '朝阳区',
'110106': '丰台区',
'110107': '石景山区',
'110108': '海淀区',
'110109': '门头沟区',
'110111': '房山区',
'110112': '通州区',
'110113': '顺义区',
'110114': '昌平区',
'110115': '大兴区',
'110116': '怀柔区',
'110117': '平谷区',
'110228': '密云县',
'110229': '延庆县',

NPM 安装后,直接 import Area from sfs-china-area 即可使用