Skip to content

Latest commit

 

History

History
46 lines (37 loc) · 774 Bytes

README.md

File metadata and controls

46 lines (37 loc) · 774 Bytes

mykad

Library to validate, retrive meta info Malaysia Identity Card (MyKad)

Installation

npm install malaysia-mykad

Usage

import mykad from 'malaysia-mykad'

const mykad = new mykad(891225085673)

Methods

isValid()

console.log(mykad.isValid())
// true

getBirthDate()

console.log(mykad.getBirthDate())
// 1989-12-25T00:00:00.000Z

getBirthPlace()

console.log(mykad.getBirthPlace())
// { code: 08, name: 'Perak' }

getGender()

console.log(mykad.getGender())
// 'Male'

getMeta()

console.log(mykad.getMeta())
// { identityCode: 891225085673, birthDate: 1989-12-25T00:00:00.000Z, birthPlace: 'Perak', gender: 'Male' }