jk-cn-address

0.0.1 • Public • Published

GB/T 2260

GB/T 2260 Build Status Coverage Current Release

The latest GB/T 2260 codes. Read the GB2260 Specification.

Installation

Install with npm:

$ npm install CHNRegion --save

Usage

var CHNRegion = require('CHNRegion');
// register revision data
CHNRegion.register('201905', require('CHNRegion/lib/201905'))

GB2260

var gb = new CHNRegion.Region(revision);

Interface for GB2260.

.get(code)

Get division for the given code.

var division = gb.get("110105")
// <GB/T 2260-201410> 110105 北京市 市辖区 朝阳区

division.name
// 朝阳区
division.code
// 110105
division.revision
// 201410

division.province
// <GB/T 2260-201410> 110000 北京市
division.prefecture
// <GB/T 2260-201410> 110100 市辖区

division.toJSON()
// { name: '朝阳区', code: '110105', revision: 201410 }
division.toString()
// 北京市 市辖区 朝阳区
division.valueOf()
// 北京市 市辖区 朝阳区

.provinces()

Return a list of provinces in Division data structure.

gb.provinces()

.prefectures(code)

Return a list of prefecture level cities in Division data structure.

gb.prefectures(110000)

.counties(code)

Return a list of counties in Division data structure.

gb.counties(110100)

revisions()

Return a list of available revisions.

CHNRegion.revisions()
// [ '201410', '201308', ..., '200212']

License

MIT.

Readme

Keywords

Package Sidebar

Install

npm i jk-cn-address

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

208 kB

Total Files

10

Last publish

Collaborators

  • zhengloong