Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New release #23

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# 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.

[![Build Status](https://travis-ci.org/egermano/brazilian-multidocument-validator.svg?branch=master)](https://travis-ci.org/egermano/brazilian-multidocument-validator)
![Node.js](https://github.com/egermano/brazilian-multidocument-validator/workflows/Node.js/badge.svg)

## Installation
## Installation

```sh
npm add br-doc-validator
# or
Expand All @@ -15,22 +16,26 @@ yarn add br-doc-validator

## Usage

```javascript
const validator = require('br-doc-validator');
const document = '00000000353';
const result = validator.documentValidator(document);
```typescript
import documentValidator from "br-doc-validator";

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

if(result) {
console.log('valid');
if (result) {
console.log("valid");
} else {
console.log('invalid');
console.log("invalid");
}
```

```sh
Output should be 'valid'
```

## Test
## Test

```sh
npm run lint
npm run test
```
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "br-doc-validator",
"version": "2.1.0",
"version": "3.0.0",
"type": "module",
"description": "Helper library to validate Brazilians documents as CPF and CNPJ.",
"main": "bin/multidocument_validator.js",
Expand Down
Loading