rwa-validator
Version:
A fast minimal package to validate Rwandan National Ids and Phone Numbers(all carriers) using Regular Expressions.
58 lines (38 loc) • 1.69 kB
Markdown
# 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