Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonathanpalma/sivar-utils
TS/JS utils para el desarrollo de sistemas salvadoreños 🇸🇻
https://github.com/jonathanpalma/sivar-utils
documento dui elsalvador hacktoberfest javascript nit sivar typescript validar
Last synced: 25 days ago
JSON representation
TS/JS utils para el desarrollo de sistemas salvadoreños 🇸🇻
- Host: GitHub
- URL: https://github.com/jonathanpalma/sivar-utils
- Owner: jonathanpalma
- License: mit
- Created: 2020-04-01T18:40:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T16:38:27.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T18:32:34.619Z (about 2 months ago)
- Topics: documento, dui, elsalvador, hacktoberfest, javascript, nit, sivar, typescript, validar
- Language: TypeScript
- Homepage: https://jonathanpalma.github.io/sivar-utils
- Size: 1.19 MB
- Stars: 36
- Watchers: 6
- Forks: 8
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
sivar-utils 🇸🇻
TS/JS utils para el desarrollo de sistemas salvadoreños (Validacion de docs DUI, NIT, etc...)
[![Version][version-badge]][package]
[![Build][build-badge]][build]
[![Install Size][size-badge]][package-size]
[![Downloads][downloads-badge]][npmcharts]
[![PRs Welcome][prs-badge]][prs]
[![Commitizen friendly][cz-badge]][cz]
[![MIT License][license-badge]][license][![All Contributors](https://img.shields.io/badge/all_contributors-4-orange.svg?style=flat-square)](#contributors-)
[![Watch on GitHub][github-watch-badge]][github-watch]
[![Star on GitHub][github-star-badge]][github-star]
[![Tweet][twitter-badge]][twitter]## Getting Started
### Installation
```
npm install --save sivar-utils
```### Usage
- #### isDUI
```ts
import { isDUI } from 'sivar-utils';const str = 'test';
const fakeDUI = '00000000-0';
const validDUI = '02495046-3'; // DISCLAIMER: taken from GoogleisDUI(str); // false
isDUI(fakeDUI); // false
isDUI(validDUI); // true
```- #### isNIT
```ts
import { isNIT } from 'sivar-utils';const str = 'test';
const fakeNIT = '0000-000000-000-0';
const validNIT = '0614-051286-129-4'; // DISCLAIMER: taken from Google
const alsoValidNIT = '06140512861294';isNIT(str); // false
isNIT(fakeNIT); // false
isNIT(validNIT); // true
isNIT(alsoValidNIT); // true
```- #### isMobilePhoneNumber
```ts
import { isMobilePhoneNumber } from 'sivar-utils';const str = 'test';
const fakeMobilePhone = '9999-9999';
const validMobilePhone = '7071-1244'; // DISCLAIMER: taken from GoogleisMobilePhoneNumber(str); // false
isMobilePhoneNumber(fakeMobilePhone); // false
isMobilePhoneNumber(validMobilePhone); // true
```- #### isResidentialPhoneNumber
```ts
import { isResidentialPhoneNumber } from 'sivar-utils';const str = 'test';
const fakeResidentialPhone = '5555-5555';
const validResidentialPhone = '2244-4777'; // DISCLAIMER: taken from GoogleisResidentialPhoneNumber(str); // false
isResidentialPhoneNumber(fakeResidentialPhone); // false
isResidentialPhoneNumber(validResidentialPhone); // true
```- #### isPhoneNumber
```ts
import { isPhoneNumber } from 'sivar-utils';const str = 'test';
const fakePhone = '1234-5678';
const validPhone = '2591-3000'; /* or '7725-4747' */ // DISCLAIMER: taken from GoogleisPhoneNumber(str); // false
isPhoneNumber(fakePhone); // false
isPhoneNumber(validPhone); // true
```- #### isPassport
```ts
import { isPassport } from 'sivar-utils';const str = 'test';
const fakePassport = '$03766021';
const validPassport = 'A12345678';isPassport(str); // false
isPassport(fakePassport); // false
isPassport(validPassport); // true
```- #### isCarPlate
```ts
import { isCarPlate } from 'sivar-utils';const str = 'test';
const fakePlate = 'XY525929';
const validNationalPlate = 'N10731'; // DISCLAIMER: taken from Google
const validParticularPlate = 'p525929'; // DISCLAIMER: taken from GoogleisCarPlate(str); // false
isCarPlate(fakePlate); // false
isCarPlate(validNationalPlate); // true
isCarPlate(validParticularPlate); // true
```## Contributing
### How to contribute?
This is a `commitizen friendly` repository, so instead of creating commits using `git commit`, please use our custom CLI by running:
```sh
npm run cz
```#### Formatting & Linting
Make sure you have installed the following plugins on your Code Editor
- [ESLint][url-eslint]
- [Prettier][url-prettier]## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Alejandro Paz
⚠️ 💻
Jorge Monge
💻 🐛
Ricardo Ramírez
🤔
Jaime Leonardo Suncin Cruz
💻 ⚠️ 🤔
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
## License
MIT © [jonathanpalma](https://github.com/jonathanpalma)
[downloads-badge]: https://img.shields.io/npm/dm/sivar-utils.svg?style=flat-square
[license-badge]: https://img.shields.io/npm/l/sivar-utils.svg?style=flat-square
[license]: https://github.com/jonathanpalma/sivar-utils/blob/master/LICENSE
[npmcharts]: http://npmcharts.com/compare/sivar-utils
[package-size]: https://packagephobia.now.sh/result?p=sivar-utils
[package]: https://www.npmjs.com/package/sivar-utils
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
[prs]: http://makeapullrequest.com
[build-badge]: https://img.shields.io/circleci/build/gh/jonathanpalma/sivar-utils?style=flat-square
[build]: https://circleci.com/gh/jonathanpalma/sivar-utils
[cz-badge]: https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square
[cz]: http://commitizen.github.io/cz-cli/
[size-badge]: https://flat.badgen.net/packagephobia/install/sivar-utils
[version-badge]: https://img.shields.io/npm/v/sivar-utils.svg?style=flat-square
[github-watch-badge]: https://img.shields.io/github/watchers/jonathanpalma/sivar-utils.svg?style=social
[github-watch]: https://github.com/jonathanpalma/sivar-utils/watchers
[github-star-badge]: https://img.shields.io/github/stars/jonathanpalma/sivar-utils.svg?style=social
[github-star]: https://github.com/jonathanpalma/sivar-utils/stargazers
[url-eslint]: https://eslint.org/
[url-prettier]: https://prettier.io/
[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20sivar-utils!%20https://github.com/jonathanpalma/sivar-utils
[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/jonathanpalma/sivar-utils.svg?style=social