https://github.com/knowbee/rwa-validator
A fast minimal package to validate Rwandan National Ids and phone numbers using Regular Expressions.
https://github.com/knowbee/rwa-validator
identity phone-number phone-numbers rwanda
Last synced: 5 months ago
JSON representation
A fast minimal package to validate Rwandan National Ids and phone numbers using Regular Expressions.
- Host: GitHub
- URL: https://github.com/knowbee/rwa-validator
- Owner: knowbee
- License: mit
- Created: 2019-12-08T08:50:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-09-26T14:54:31.000Z (over 4 years ago)
- Last Synced: 2025-10-06T05:53:05.101Z (9 months ago)
- Topics: identity, phone-number, phone-numbers, rwanda
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/rwa-validator
- Size: 15.6 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# rwa-validator
[](https://travis-ci.org/knowbee/rwa-validator)
[](https://codeclimate.com/github/knowbee/rwa-validator/maintainability)
[](https://www.npmjs.com/package/rwa-validator)
[](https://david-dm.org/knowbee/rwa-validator)
[](https://www.npmjs.com/package/rwa-validator)
[](https://github.com/ellerbrock/open-source-badge/)
[](https://github.com/ellerbrock/open-source-badge/)
[](https://nodei.co/npm/rwa-validator/)
A fast minimal package to validate Rwandan National Ids and Phone Numbers(all carriers) using Regular Expressions.
## Installation
```js
npm install rwa-validator
```
or
```js
yarn add rwa-validator
```
or
## Usage
- Validating Phone Number
```js
const { isNationalId, isPhoneNumber } = require("rwa-validator");
isPhoneNumber("0788854444"); // true
isPhoneNumber("0778854444"); // false
```
- Validating National ID
```js
// must be 16 digit numbers
isNationalId("1199672222000040"); // true
isNationalId("1201772222000040"); // false
```
# Contribution
- Please before making a PR, read first this [Contributing Guideline](./CONTRIBUTING.md)
## License
MIT
## Author
Igwaneza Bruce