https://github.com/radarsu/validate-polish
Utility library for validation of PESEL, NIP, REGON, identity card etc. Aimed mostly at Polish enviroment. [Polish] Walidacja numerów pesel, nip, regon, dowodu osobistego.
https://github.com/radarsu/validate-polish
identity-card identity-card-validation identitycard javascript javascript-library nip node nodejs nodejs-library pesel pesel-validation polish polish-language polski polskie regon regon-validation typescript typescript-library validation-library
Last synced: 2 months ago
JSON representation
Utility library for validation of PESEL, NIP, REGON, identity card etc. Aimed mostly at Polish enviroment. [Polish] Walidacja numerów pesel, nip, regon, dowodu osobistego.
- Host: GitHub
- URL: https://github.com/radarsu/validate-polish
- Owner: radarsu
- License: mit
- Created: 2016-05-11T05:57:31.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-03-27T18:27:50.000Z (about 2 years ago)
- Last Synced: 2025-04-14T16:12:53.074Z (2 months ago)
- Topics: identity-card, identity-card-validation, identitycard, javascript, javascript-library, nip, node, nodejs, nodejs-library, pesel, pesel-validation, polish, polish-language, polski, polskie, regon, regon-validation, typescript, typescript-library, validation-library
- Language: TypeScript
- Homepage:
- Size: 628 KB
- Stars: 43
- Watchers: 6
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
validate-polish
Utility library for validation of PESEL, NIP, REGON, and identity card numbers. Aimed mostly at the Polish environment.
[Polish] Walidacja numerów PESEL, NIP, REGON, oraz dowodu osobistego.[](https://www.buymeacoffee.com/radarsu)
## Table of contents
1. [Getting Started](#getting-started)
2. [Usage](#usage)
3. [Features](#features)
## Getting Started
`npm i validate-polish`## Usage
### General```ts
import { validatePolish } from 'validate-polish';if (!validatePolish.pesel(`92060512181`)) {
throw new Error(`Invalid pesel.`);
}if (!validatePolish.nip('115667734')) {
throw new Error(`Invalid nip.`);
}if (!validatePolish.regon(`1251677`)) {
throw new Error(`Invalid regon.`);
}if (!validatePolish.identityCard(`14124142`)) {
throw new Error(`Invalid identity card.`);
}
```### Browser
In browser validate-polish package is wrapped twice `validatePolish.validatePolish`.
```html
console.log(validatePolish.validatePolish);
```
## Features
- **CDN** - available via cdn (https://cdn.jsdelivr.net/npm/validate-polish@latest/dist/index.browser.js)
- **Cross-platform** - works in Node.js, browser and with bundlers such as webpack
- **Fast, lightweight, 0 dependencies** - no dependencies ensure there are no security breaches from other packages
- **Maintained** - if you need additional functionality feel free to create PR or an Issue
- **Strongly typed** - library written fully in TypeScript
- **Supports PESEL, REGON (9 and 14), NIP, IDENTITY CARD** - also validates day and month correctness including century encoded in month.
- **Tested** - has tests on dozens of valid and invalid chunks of data to make sure validations are performed flawlessly