br-document-utils

1.0.2 • Public • Published

br-document-utils

Installation

$ npm i br-document-utils

Example

CNPJ

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

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'

Readme

Keywords

Package Sidebar

Install

npm i br-document-utils

Weekly Downloads

4

Version

1.0.2

License

MIT

Unpacked Size

7.6 kB

Total Files

7

Last publish

Collaborators

  • delucagabriel