codicefiscalejs-node
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

CodiceFiscaleJS/Node

CodiceFiscaleJS/Node is a javascript and typescript utility library to compute and validate Italian Italian Tax code (codice fiscale). Inspired to CodiceFiscaleJS, it was rewritten from scratch for Node.js, in order to be faster (actually it's, on average, twice faster than CodiceFiscaleJS 🚄) and hopefully easier to use.

Don't fork, contribute!

Please, don't fork and republish this repository with silly minor changes! 😠 Please, give your contribution instead: any help is more than welcome!

Installation

Node

npm install @CodiceFiscaleJS/node --save

Usage

var {compute, reverse, validate} = require('@CodiceFiscaleJS/node');
 
const cf = compute({
    nome: 'Marco',
    cognome: 'Rossi',
    sesso: 'M',
    comune: 'Milano',
    provincia: 'MI',
    giorno: 1,
    mese: 1,
    anno: 1980   
}) // RSSMRC80A01F205Z
 
 
const userData = reverse("RSSMRC80A01F205Z")
/
*{
    nome: 'Marco',
    cognome: 'Rossi',
    sesso: 'M',
    comune: 'Milano',
    provincia: 'MI',
    giorno: 1,
    mese: 1,
    anno: 1980   
}
*/
 
const valid = isValid("RSSMRC80A01F205Z") // true
const notValid = isValid("ABCDEF12G34H567I") //false

TODO

  • Docs
  • Add Typescript types

Package Sidebar

Install

npm i codicefiscalejs-node

Weekly Downloads

3

Version

0.0.1

License

CC-BY-ND-4.0

Unpacked Size

3.25 MB

Total Files

19

Last publish

Collaborators

  • lucavandro