# br-document-utils

> Gerador e Validador de documentos brasileiros

Latest version **1.0.2** (published 2023-07-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install br-document-utils
pnpm add br-document-utils
yarn add br-document-utils
bun add br-document-utils
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-07-01 |
| First published | 2023-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Gabriel Mendes de Luca |
| Maintainers | delucagabriel |
| Keywords | cnpj, cpf |

## Links

- npm: https://www.npmjs.com/package/br-document-utils
- Repository: https://github.com/delucagabriel/br-doc-utils
- Homepage: https://github.com/delucagabriel/br-doc-utils#readme
- Issues: https://github.com/delucagabriel/br-doc-utils/issues
- npm.io page: https://npm.io/package/br-document-utils

## Recent versions

- 1.0.2 (latest) — 2023-07-01
- 1.0.1 — 2023-06-26
- 1.0.0 — 2023-06-26

## README

# br-document-utils

## Installation
```shell
$ npm i br-document-utils
```

## Example

#### CNPJ
```typescript
import { CNPJ } from 'br-document-utils'

// Gerar um CNPJ
CNPJ.generate()

// Verificar se um CNPJ é válido
CNPJ.validate('66.696.268/0001-18') // true
CNPJ.validate('66.696.268/0001-29') // false

// Formatar um CNPJ
CNPJ.format('56713033000133') // '56.713.033.0001-33'

```

#### CPF
```typescript
import { CPF } from 'br-document-utils'

// Gerar um CPF
CPF.generate()

// Verificar se um CPF é válido
CPF.validate('29715575021') // true
CPF.validate('297.155.750-42') // false

// Formatar um CPF
CPF.format('29715575021') // '297.155.750-21'

```

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