Skip to content

JavanShen/china-region-data

Repository files navigation

中国省市区数据

CI codecov npm

特性

  • 省市区关联数据

  • 支持TS类型提示

  • 通过数据关联测试

安装

npm i china-region-data

使用方式

import { province, city, county } from 'china-region-data'

//do something

数据格式

省份数据

const province = [
    {
        //省份名称
        name: '浙江省',
        //行政区划代码
        id: '330000000000'
    },
    //...
]

市级数据

const city = {
    //省行政区划代码
    '330000000000': [
        {
            //上级省份
            province: '浙江省',
            //市级名称
            name: '湖州市',
            //行政区划代码
            id: '330500000000'
        },
        //...
    ],
    //...
}

地区数据

const country = {
    //市行政区划代码
    '330500000000': [
        {
            //上级市级
            city: '湖州市',
            //地区名称
            name: '德清县',
            //行政区划代码
            id: '330521000000'
        }
        //...
    ],
    //...
}