Skip to content

tiaanduplessis/sa-id-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ef9481e Β· May 25, 2022

History

7 Commits
Mar 17, 2018
May 25, 2022
May 25, 2022
Mar 22, 2018
Mar 17, 2018
Mar 17, 2018
May 25, 2022
May 25, 2022
May 25, 2022

Repository files navigation

sa-id-gen

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

Generate fake South African ID

Table of Contents

About

Generates a random fake South African. Can be configured when needed. Based on generate-sa-idnumbers.

Install

Install the package locally within you project folder with your package manager:

With npm:

npm install sa-id-gen

With yarn:

yarn add sa-id-gen

With pnpm:

pnpm add sa-id-gen

Usage

const generateID = require('sa-id-gen')

console.log(generateID({
  year: '93', // Last two digits of year
  month: '01',
  day: '21',
  sequence: '908', // 000 - 999
  gender: 'male', // 'male' or 'female'
  citizenship: 'citizen' // 'citizen' or 'resident'
})) // ''9301215908081'

Using the CLI:

$ sa-id-gen

New ID generated:

πŸ†”   9309165206083

The ID has been copied to your clipboard. πŸ“‹

Can also be configured

$ sa-id-gen --gender=female

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
  3. Submit a pull request

License

MIT