Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 680 Bytes

File metadata and controls

41 lines (29 loc) · 680 Bytes

Brazilian Document Validator

A Node.js module that validate brazilian documents as CPF and CPNJ.

🇧🇷 Modulo em Node.js para validação de documento CPF e CNPJ.

Node.js

Installation

npm add br-doc-validator
# or
yarn add br-doc-validator

Usage

import documentValidator from "br-doc-validator";

const document = "00000000353";
const result: boolean = documentValidator(document);

if (result) {
  console.log("valid");
} else {
  console.log("invalid");
}
Output should be 'valid'

Test

npm run lint
npm run test