Giter Site home page Giter Site logo

city's Introduction

city

一款用于生成行政区划联动数据的小工具,如

[{
    "name":"北京市",
    "children":[{
        "name":"东城区"
    },{
        "name":"西城区"
    }]
},{
    "name":"天津市",
    "children":[{
        "name":"和平区"    
    }]    
}]

特色

  • 数据权威,来自国家统计局,每年更新
  • 自由选择是否包含海外国家列表数据(来自维基百科)
  • 自由选择生成一级(省)、二级(省市)、三级(省市县)数据
  • 可自定义数据对象键名(key)
  • 支持输出JSON、原生js文件、AMD/CMD规范js文件
  • 支持输出压缩后的代码及格式化后的代码
  • 支持输出地区代码(身份证前6位)

使用方法

使用npm安装

npm install -g city

使用:

city

支持参数:

  • -V --version 输出版本号
  • -h --help 输出菜单
  • -l --level level 输出指定级别行政区数据,取值1-3
  • -k --key name,children,code 自定义输出格式中的对象键名(必须包含三个值)
  • -o --output fileName 输出文件路径
  • -j --js varibleName 以指定变量名输出js文件(配合--output选项写入文件)
  • -a --amd 以AMD规范输出js文件
  • -m --cmd 以CMD规范输出js文件
  • -p --pretty 格式化输出
  • -s --overseas 包含海外地区
  • -c --code 包含地区编码(身份证前6位)
  • -u --update 重新抓取原始数据

Todo

city's People

Contributors

toobug avatar basecss avatar

Watchers

domainbank 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.