JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16
  • Score
    100M100P100Q56616F
  • License Apache-2.0

Helper library to validate Brazilians documents as CPF and CNPJ.

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.

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