Skip to content

🇿🇦 Validate and decode information from an South African ID

License

Notifications You must be signed in to change notification settings

tiaanduplessis/south-african-id-info

Repository files navigation

🇿🇦 south-african-id-info

Validate and decode information from an South African ID



Built with ❤︎ by Tiaan and contributors

Table of Contents

Table of Contents
  • Install
  • Usage
  • CLI
  • Contribute
  • License
  • Install

    Greenkeeper badge

    $ npm install --save south-african-id-info
    # OR
    $ yarn add south-african-id-info

    Usage

    The module exports a single function that takes a number string as argument and returns an object.

    const southAfricanIdInfo = require('south-african-id-info')
    
    console.log(southAfricanIdInfo('9301215029086'))
    //	{ valid: true,
    //  	birthDate: 1993-01-20T22:00:00.000Z,
    //  	gender: 'male', // 'female' //
    //  	citizenship: 'SA citizen' // 'permanent resident'
    // 	}
    
    console.log(info('9202204720082'))
    // { valid: false }

    CLI

    $ npm install --global south-african-id-info
    # OR
    $ yarn global add south-african-id-info

    Then:

    $ sa-id-info 9301215029086
    # valid:       true
    # birthDate:   Thu Jan 21 1993 00:00:00 GMT+0200 (SAST)
    # gender:      male
    # citizenship: SA citizen

    Contribute

    Contributions are welcome. Please open up an issue or create PR if you would like to help out.

    Note: If editing the README, please conform to the standard-readme specification.

    License

    Licensed under the MIT License.

    About

    🇿🇦 Validate and decode information from an South African ID

    Topics

    Resources

    License

    Stars

    Watchers

    Forks

    Packages

    No packages published