New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@fekit/idcard

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fekit/idcard

中国身份证号详细信息获取

latest
npmnpm
Version
1.0.2
Version published
Weekly downloads
8
-46.67%
Maintainers
2
Weekly downloads
 
Created
Source

@fekit/idcard

中国身份证号合法性校验,获取身份证详细信息(含一代及二代身份证)

安装

yarn add @fekit/idcard

npm i @fekit/idcard

引入

import idcard from '@fekit/idcard';

使用

const info: any = idcard(id) || {};

返回的数据结构

// 身份证合法返回的数据结构
{
    "gender": "女", //性别
    "birthday": "1967-1-11", // 出生日期
    "province": {  //省
        "code": "410000",
        "text": "河南省"
    },
    "city": {  // 市
        "code": "410400",
        "text": "平顶山市"
    },
    "area": { // 区县
        "code": "410421",
        "text": "宝丰县"
    },
    "adreass": "河南省平顶山市宝丰县", // 籍贯
    "cardText": "大陆",
    "age": 33,  // 年龄
    "zodiac": "鼠",  // 生肖
    "constellation": "射手座"  // 星座
}

// 身份证非法时返回的数据结构
false // 校验失败直接返回false

版本

1.0.0
校验身份证号合法性,并返回具体信息

Keywords

身份证

FAQs

Package last updated on 09 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts