chcitys

1.0.0 • Public • Published

Node.js: chcitys

chcitys 查询最新的中国境内行政区划信息,返回各级省市县区的名称,编码和归属关系。

数据来源

数据来源于中华人民共和国民政部网站

Installation

npm install --save chcitys

Usage

var cityree = require('chcitys').getCityTree 
var city1 = citytree('安徽省');
// ...
var city1 = citytree('合肥市');
// ...

Methods

NOTE: You can still use the native Node.js methods. They are copied over to fs-extra.

getCityTree()

getCityTree(cityname)

返回指定城市或者省的信息,以及其下属城市树,树的结构如下:

  {
       id : '110000', name : '北京市',
       nodes : [
       		{ id : '110101' , name : '东城区'},
			...
       ] 
  }
  • params: @cityname :城市或者省名称,例如 : '北京市' '安徽省'
  • result: 返回城市树,不存在则返回undefined

License

Licensed under MIT

Copyright (c) 2011-2015 JP Richardson

Readme

Keywords

Package Sidebar

Install

npm i chcitys

Weekly Downloads

1

Version

1.0.0

License

ISC

Last publish

Collaborators

  • shuangtao.li