valid-south-african-id

πŸ‡ΏπŸ‡¦ Perform regex and checksum match to check if given number string is a valid South African ID

Usage no npm install needed!

<script type="module">
  import validSouthAfricanId from 'https://cdn.skypack.dev/valid-south-african-id';
</script>

README

valid-south-african-id

package version package downloads standard-readme compliant package license make a pull request Greenkeeper badge

πŸ‡ΏπŸ‡¦ Perform regex and checksum match to check if given number string is a valid South African ID

Table of Contents

Install

This project uses node and npm.

$ npm install valid-south-african-id
$ # OR
$ yarn add valid-south-african-id

Usage

const validSouthAfricanId = require('valid-south-african-id')

console.log(validSouthAfricanId('yourIdNumber')) // true || false

CLI

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

Then:

$ valid-sa-id 9202204720082
# false

Contribute

  1. Fork it and create your feature branch: git checkout -b my-new-feature
  2. Commit your changes: git commit -am 'Add some feature'
  3. Push to the branch: git push origin my-new-feature
  4. Submit a pull request

License

MIT