Coverage
Statistics
JS open-source lib to generate and validate CPF.
Tool could be accessed on tiagoporto.github.io/gerador-validador-cpf.
Read in other languages: English, Português(Brasil)
npm install gerador-validador-cpf --save
import { generate } from 'gerador-validador-cpf'
generate() // Generates a CPF in the format 00000000000
generate({ format: true }) // Generates a CPF in the format 000.000.000-00
import { validate } from 'gerador-validador-cpf'
validate('123.456.789-00')
// or
validate('123.456.789-00')
Note: characters like .
, -
and space
are allowed.
Gerador e validador de CPF is released under the terms of the MIT license.