Validate CPF and CNPJ
npm install validate-documents
!Code Size
!Downloads
!LICENSE
---
---
---
---
bash
Installing package
Yarn
$ yarn add validate-documentsnpm
$ npm install validate-documents
`---
Exemple of use:
$3
`javascript
import { validateCpf } from 'validate-documents'const isValidCpf = validateCpf('72994324040')
if(isValidCpf) {
// Follow the flow with valid CPF, how create user
}else{
// Follow the flow with invalid CPF, how return response with error and status code 400
}
`$3
`javascript
import { createFakeCpf } from 'validate-documents'try {
const cpfCreated = createFakeCpf()
console.log('created CPF:', cpfCreated)
} catch (error) {
console.error({
error_name: error.name, // Error
error_message: error.message, // Max retry to create fake cpf was hit
})
}
``###### Made with Love by Ramon Paolo Maram :3