cf-it-validator

1.0.7 • Public • Published

CF Italy validator

This package purpose is to provide a simple solution for a form validation where the user must insert his Italian Fiscal code

How to install

run npm i cf-it-validator inside your project

How to use

Just import the package where you need and use the validation function:

import {validateITCF} from 'cf-it-validator'

const isValid = validateITCF(fiscal_code, {name, lastname, birthdate /*use this formats: DD/MM/YY or DD/MM/YYYY*/, municipe})

for municipes the list is taken here

everything is calculated in lowercase, so no need to worry about case sensitiveness

Other info

You can check just a part of the fiscal code, for example if in the object you pass only the name and the lastname the library will check only the first six characters

Package Sidebar

Install

npm i cf-it-validator

Weekly Downloads

2

Version

1.0.7

License

ISC

Unpacked Size

2.23 MB

Total Files

12

Last publish

Collaborators

  • flowrome