pesel-utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Pesel Utils

Bunch of utilities useful when working with PESEL numbers

Build Status XO code style install size

Highlights

  • Simple API
  • 0 dependencies
  • Well tested
  • Uses 4-step PESEL validation (lenght + year + month + checksum)
  • Written in TypeScript

Install

$ npm install pesel-utils

Usage

const {isValidPesel, checkGender, getDateOfBirth} = require('pesel-utils');
 
isValidPesel('371340514609'); //=> false
checkGender('69021818876'); //=> 'male'
getDateOfBirth('75040373939'); //=> '1975/04/03'

API

isValidPesel(pesel)

Returns a boolean of whether the provided PESEL is valid or not.

pesel

Type: string

PESEL you want to check.

checkGender(pesel)

Returns a string with gender (male or female).

pesel

Type: string

PESEL you want to check.

getDateOfBirth(pesel)

Returns a string with date of birth, extracted from PESEL (in ISO 8601 format).

pesel

Type: string

PESEL you want to check.

License

MIT © Antoni Kepinski

Readme

Keywords

none

Package Sidebar

Install

npm i pesel-utils

Weekly Downloads

44

Version

1.0.4

License

MIT

Unpacked Size

9.69 kB

Total Files

6

Last publish

Collaborators

  • akepinski