1.0.0 • Published 5 years ago

malaysia-mykad v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

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' }