Nutella Pancake Machine

    kad-pengenalan

    1.2.0 • Public • Published

    Kad Pengenalan

    Malaysian IC helper to make life easier.

    Installing

    yarn add kad-pengenalan


    Usage

    import KadPengenalan from "../src/KadPengenalan"
    
    const kp = new KadPengenalan("910622126661", {
      dateFormat: "DD-MMMM-YYYY",
      gender: {
        male: "Lelaki"
      }
    })
    
    console.log(kp.isValidDateOfBirth) // true
    console.log(kp.isValidState) // true
    console.log(kp.isValid) // true
    console.log(kp.data)
    // { dateOfBirth: '22-June-1991',
         stateName: 'Sabah',
         gender: 'Lelaki' }
    

    isValid (Boolean)

    Valid IC Number

    Options

    KadPengenalan(icNumber, options)
    • dateFormat String - Valid moment date format

    // dateFormat: "DD-MMMM-YYYY"

    • gender Object - Text value for male and female
    gender: {
      "male": "Lelaki",
      "female": "Perempuan"
    }
    

    Install

    npm i kad-pengenalan

    DownloadsWeekly Downloads

    0

    Version

    1.2.0

    License

    MIT

    Last publish

    Collaborators

    • d30jeff