south-african-id-info

1.0.1 • Public • Published

🇿🇦 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.

Dependents (0)

Package Sidebar

Install

npm i south-african-id-info

Weekly Downloads

9

Version

1.0.1

License

MIT

Unpacked Size

9.13 kB

Total Files

9

Last publish

Collaborators

  • tiaanduplessis