2.1.1 • Published 4 years ago

validation-docs-br v2.1.1

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

Brazilian documents validator

List of documents to make authentication

  • CPF (Cadastro de Pessoa Física)
  • CNPJ (Cadastro Nacional da Pessoa Jurídica)
  • PIS (Programa de Integração Social)

Install with NPM

$ npm i validation-docs-br

Install with YARN

$ yarn add validation-docs-br

Basic usage

Import file

import { AuthenticateDocs } from 'validation-docs-br';

or

const { AuthenticateDocs } = require('validation-docs-br');

Using authenticators

CPF

const authenticate = new AuthenticateDocs()
const result = authenticate.cpf({data: '123.456.789-10'})
// OR
const result = authenticate.cpf({data: 12345678910})

CNPJ

const authenticate = new AuthenticateDocs()
const result = authenticate.cnpj({data: '01.234.567/8910-11'})
// OR
const result = authenticate.cnpj({data: 01234567891011})

PIS

const authenticate = new AuthenticateDocs()
const result = authenticate.pis({data: '123.45678.91-0'})
// OR
const result = authenticate.pis({data: 12345678910})

Responses

In both cases the response is a boolean value.

  • true has mean that the document is valid

  • false has mean that the document is invalid

2.1.1

4 years ago

2.0.9

4 years ago

2.0.10

4 years ago

2.1.0

4 years ago

2.0.7

4 years ago

2.0.8

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.0

5 years ago