valid-south-african-id
Version:
🇿🇦 Perform regex and checksum match to check if given number string is a valid South African ID
69 lines (49 loc) • 1.98 kB
Markdown
# valid-south-african-id
[](https://npmjs.org/package/valid-south-african-id)
[](https://npmjs.org/package/valid-south-african-id)
[](https://github.com/RichardLitt/standard-readme)
[](https://npmjs.org/package/valid-south-african-id)
[](http://makeapullrequest.com)
🇿🇦 Perform regex and checksum match to check if given number string is a valid South African ID
## Table of Contents
- [valid-south-african-id](#valid-south-african-id)
- [Table of Contents](#table-of-contents)
- [Install](#install)
- [Usage](#usage)
- [CLI](#cli)
- [Contributing](#contributing)
- [License](#license)
## Install
Install the package locally within you project folder with your package manager:
With `npm`:
```sh
npm install valid-south-african-id
```
With `yarn`:
```sh
yarn add valid-south-african-id
```
With `pnpm`:
```sh
pnpm add valid-south-african-id
```
## Usage
```js
const validSouthAfricanId = require('valid-south-african-id')
console.log(validSouthAfricanId('yourIdNumber')) // true || false
```
### CLI
```sh
$ npm install --global valid-south-african-id
# OR
$ yarn global add valid-south-african-id
```
Then:
```sh
$ valid-sa-id 9202204720082
# false
```
## Contributing
Got an idea for a new feature? Found a bug? Contributions are welcome! Please [open up an issue](https://github.com/tiaanduplessis/valid-south-african-id/issues) or [make a pull request](https://makeapullrequest.com/).
## License
[MIT © Tiaan du Plessis](./LICENSE)