Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

validate-polish

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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.

  • 2.0.39
  • npm
  • Socket score

Version published
Weekly downloads
3K
decreased by-44.02%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Table of contents

  1. Usage

  2. Getting Started

  3. Features

Usage

General

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.

<script src="https://cdn.jsdelivr.net/npm/validate-polish@latest/dist/index.browser.js"></script>
<script>
    console.log(validatePolish.validatePolish);
</script>

Getting Started

npm i validate-polish

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
  • Tested - has tests on dozens of valid and invalid chunks of data to make sure validations are performed flawlessly

Keywords

FAQs

Package last updated on 09 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc