validate-polish-ext

Utility library for validation of PESEL, NIP, REGON, identity card etc. Aimed at mostly at Polish enviroment. [Polish] Walidacja numerów pesel, nip, regon, dowodu osobistego.

Usage no npm install needed!

<script type="module">
  import validatePolishExt from 'https://cdn.skypack.dev/validate-polish-ext';
</script>

README

validate-polish-ext
Simple validation of PESEL, NIP, REGON, identity card.

TypeScript utility for Polish developers.

npm

Description

Utility library for validation of PESEL, NIP, REGON, identity card etc. Aimed at mostly at Polish enviroment. [Polish] Walidacja numerów pesel, nip, regon, dowodu osobistego.

Installation

npm i validate-polish-ext

Features

  • Fast, lightweight, no dependencies required.
  • PESEL validation.
  • NIP validation.
  • REGON ( 9, 14 ) validation.
  • Identity card ([Polish] dowód osobisty) validation.

Usage

import { validatePolish } from 'validate-polish-ext';

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.`);
}