Skip to content

edwinwong90/mykad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

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

About

Malaysia Identity Card validation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published