Package Exports
- br-doc-validator
- br-doc-validator/bin/multidocument_validator.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (br-doc-validator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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.
Installation
npm add br-doc-validator
# or
yarn add br-doc-validatorUsage
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