# br-doc-validator

> Helper library to validate Brazilians documents as CPF and CNPJ.

Latest version **3.0.0** (published 2024-11-07) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install br-doc-validator
pnpm add br-doc-validator
yarn add br-doc-validator
bun add br-doc-validator
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2024-11-07 |
| First published | 2018-01-29 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 20.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Bruno Germano |
| Maintainers | egermano |
| Keywords | Brasil, Validator, Documents, CPF, CNPJ |

## Links

- npm: https://www.npmjs.com/package/br-doc-validator
- Repository: https://github.com/egermano/brazilian-multidocument-validator
- Homepage: https://github.com/egermano/brazilian-multidocument-validator#readme
- Issues: https://github.com/egermano/brazilian-multidocument-validator/issues
- npm.io page: https://npm.io/package/br-doc-validator

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2024-11-07
- 2.1.0 — 2024-10-22
- 2.0.0 — 2023-01-03
- 1.1.4 — 2020-03-31
- 1.1.3 — 2020-03-31
- 1.1.2 — 2020-02-24
- 1.1.1 — 2020-02-24
- 1.1.0 — 2020-02-24
- 1.0.3 — 2018-01-29
- 1.0.2 — 2018-01-29
- 1.0.1 — 2018-01-29

## 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](https://github.com/egermano/brazilian-multidocument-validator/workflows/Node.js/badge.svg)

## Installation

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

## Usage

```typescript
import documentValidator from "br-doc-validator";

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

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

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

## Test

```sh
npm run lint
npm run test
```

---
_Source: https://npm.io/package/br-doc-validator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
