Giter Site home page Giter Site logo

administrative-divisions-of-china's Introduction

Administrative-divisions-of-China

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

Deps npm npm GitHub license

JSON

文件列表 格式化 压缩版
省份数据 provinces.json provinces.min.json
城市数据 cities.json cities.min.json
区县数据 areas.json areas.min.json
乡镇(街道)数据 streets.json streets.min.json
“省、市” 二级联动数据 address2.json address2.min.json
“省、市、区” 三级联动数据 address3.json address3.min.json
“省、市、区、镇” 四级联动数据 address4.json address4.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.

administrative-divisions-of-china's People

Contributors

modood avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.