Coder Social home page Coder Social logo

gb2260.js's Introduction

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 gb2260 --save

Usage

var gb2260 = require('gb2260');
// register revision data
gb2260.register('201410', require('gb2260/lib/201410'))

GB2260

var gb = new gb2260.GB2260(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.

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

License

MIT.

gb2260.js's People

Contributors

lepture avatar chemzqm avatar juniel 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.