parse-cn-idcard
v0.1.3
Published
解析中国身份证号码(地址,性别,生日,星座),支持 18 位和 15 位身份证
Downloads
10
Maintainers
Readme
parse-cn-idcard
解析中国身份证号码(地址,性别,生日,星座),支持 18 位和 15 位身份证
Installation
$ npm install --save parse-cn-idcard
or
$ npm install -g parse-cn-idcard
Test
$ npm test
Usage
api
var parse_id = require('parse-cn-idcard');
var result = parse_id('110105199410221234');
console.log(result);
{
area: {
id: '110105',
name: '北京市朝阳区'
},
birthday: {
date: '19941022',
constellation_cn: '天秤座',
constellation_en: 'Libra'
},
gender: {
cn: '男',
en: 'Male'
}
}
cli
Usage: parse-id [options]
Options:
-h, --help output usage information
-V, --version output the version number
Usage:
$ parse-id [idcard number] 查询特定的身份证号码
Examples:
$ parse-id 110105199410221234
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
License
this repo is released under the MIT License.