validation documents
Version 1.2.8
이 프로젝트는 브라질의 사회 문서를 검증하기위한 LIB입니다. 이것은 CPF 및 CNPJ를 검증합니다.
간단합니다. 단 터미널에서 명령을 실행하십시오.
# Installing package
# Yarn
$ yarn add validate-documents
# npm
$ npm install validate-documents 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
} 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
} )
}