malaysia-mykad
v1.0.0
Published
Malaysia Identity Card Validation
Downloads
6
Maintainers
Readme
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' }