Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

china-division

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

china-division

中华人民共和国行政区划:省份、城市、区县、乡镇(街道)

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
increased by1.1%
Maintainers
1
Weekly downloads
 
Created
Source

Administrative-divisions-of-China

中华人民共和国行政区划:省份、城市、区县、乡镇(街道)

  • 国家统计局最新数据: 中华人民共和国国家统计局-行政区划代码
  • 本项目已更新至: 最新县及县以上行政区划代码(截止2015年9月30日)

Deps npm npm GitHub license

JSON

文件列表格式化压缩版
省份数据provinces.jsonprovinces.min.json
城市数据cities.jsoncities.min.json
区县数据areas.jsonareas.min.json
乡镇(街道)数据streets.jsonstreets.min.json
“省、市” 二级联动数据address2.jsonaddress2.min.json
“省、市、区” 三级联动数据address3.jsonaddress3.min.json
“省、市、区、镇” 四级联动数据address4.jsonaddress4.min.json

TEST

$ npm test

> mocha -t 5000

  中华人民共和国行政区划:
    ✓ 省份数据
    ✓ 城市数据
    ✓ 区县数据
    ✓ 乡镇(街道)数据
    ✓ “省、市” 二级联动数据
    ✓ “省、市、区” 三级联动数据
    ✓ “省、市、区、镇” 四级联动数据
    ✓ “某省、某市、某县、某镇” 不存在

  8 passing (12ms)

NPM(不建议)

注意:

由于获取数据为同步操作,出于性能考虑,不建议使用 Node 模块这种方式。

建议 下载 JSON 文件 然后在代码里使用 require 引入,原因参考 Node.js Modules

安装:

$ npm install --save china-division

使用:

var chinaDivision = require('china-division');

// 省份数据
var provinces = chinaDivision.provinces;

// 城市数据
var cities = chinaDivision.cities;

// 区县数据
var areas = chinaDivision.areas;

// 乡镇(街道)数据
var streets = chinaDivision.streets;

// “省、市” 二级联动数据
var address2 = chinaDivision.address2;

// “省、市、区” 三级联动数据
var address3 = chinaDivision.address3;

// “省、市、区、镇” 四级联动数据
var address4 = chinaDivision.address4;

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

this repo is released under the MIT License.

Keywords

FAQs

Package last updated on 13 Oct 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc