# @ikamva/saidvalidator

> Validates South African ID

Latest version **2.1.0** (published 2023-10-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ikamva/saidvalidator
pnpm add @ikamva/saidvalidator
yarn add @ikamva/saidvalidator
bun add @ikamva/saidvalidator
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2023-10-18 |
| First published | 2020-07-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14.0.0 <20.0.0 |
| Dependencies | 0 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sivuyile Magutywa |
| Maintainers | applicafropkg |
| Keywords | SA ID |

## Links

- npm: https://www.npmjs.com/package/@ikamva/saidvalidator
- npm.io page: https://npm.io/package/@ikamva/saidvalidator

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2023-10-18
- 2.0.1 — 2023-10-14
- 2.0.0 — 2023-10-14
- 1.1.1 — 2023-09-21
- 1.0.1 — 2023-08-03
- 1.0.0 — 2023-08-03
- 0.2.0 — 2020-12-11
- 0.1.15 — 2020-12-10
- 0.1.14 — 2020-08-11
- 0.1.13 — 2020-07-28
- 0.1.12 — 2020-07-20
- 0.1.11 — 2020-07-19
- 0.1.10 — 2020-07-18
- 0.1.9 — 2020-07-17
- 0.1.8 — 2020-07-17
- … 3 more at https://npm.io/package/@ikamva/saidvalidator/versions

## README

<h1 align="center">SA ID VALIDATOR</h1>

## ℹ️️ Description

This package validates South African ID

<br>

## 🔧 How to Install

Install using npm:

```
npm install @ikamva/saidvalidator
```

Install using yarn:

```
yarn add @ikamva/saidvalidator

```
Install using pnpm:

```
pnpm add @ikamva/saidvalidator

```

<br>

## 👨🏻‍🏫 How to Use

### Get full details
```ts
import { validateSAID, Validate }  from "@ikamva/saidvalidator";

// Get all details if valid
const saIDData: Validate = validateSAID("1601016372082"); // {valid: true, gender: 'Male', citizenship: 'SA', dob: '01 Jan 2016'}


// If invalid
const saIDData: Validate = validateSAID("1601016372081"); // {valid: false, gender: 'Invalid ID', dob: 'Invalid ID', citizenship: 'Invalid ID'}

```

### Check Valid ID Only
```ts
import { isSAID }  from "@ikamva/saidvalidator";

// Check if valid sa id only
const isValid = isSAID("1601016372082"); // true
```

### Get D.O.B 
```ts
import { getDOB }  from "@ikamva/saidvalidator";

// returns DD MMM YYYY or 'Invalid ID'
const gender = getDOB("1601016372082"); // 01 Jan 2016 
```

### Get Gender 
```ts
import { getGender }  from "@ikamva/saidvalidator";

// returns 'Male' or 'Female' or 'Invalid ID'
const gender = getGender("1601016372082"); // Male 
```

### Get Citizenship 
```ts
import { getCitizenship }  from "@ikamva/saidvalidator";

// returns 'SA' or 'Other' or 'Invalid ID'
const citizen = getCitizenship("1601016372082"); // SA 
```
<br>

## 💁🏻 Contributing

This is an open source project. Any contribution would be greatly appreciated!

---
_Source: https://npm.io/package/@ikamva/saidvalidator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
