codicefiscalejs-node
v0.0.1
Published
A Node.js library to compute, validate and reverse Italian Tax Code (codice fiscale)
Downloads
15
Maintainers
Readme
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