Skip to content
/ cnpj Public

πŸ‡§πŸ‡· Format, validate and generate CNPJ numbers in Node & Deno

License

Notifications You must be signed in to change notification settings

gabeidx/cnpj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5d64a30 Β· Jul 29, 2024

History

97 Commits
Jul 29, 2024
Sep 28, 2021
Aug 30, 2017
Aug 30, 2017
Sep 28, 2021
Jul 29, 2024
Jul 29, 2024
Jul 29, 2024
Jul 29, 2024
Jul 29, 2024
Jul 29, 2024
Sep 28, 2021
Jul 29, 2024
Jul 29, 2024
Jul 29, 2024

Repository files navigation

CNPJ

Format, validate and generate CNPJ numbers.

Installation

Node

npm install cnpj

or, if you are using jsr

npx jsr add @brazil/cnpj
import { validate, format, generate } from 'cnpj';

Deno

deno add @brazil/cnpj
import { validate, format, generate } from '@brazil/cnpj';

Usage

// Validation
const valid = validate('38.981.218/0001-47'); // true

// Format
const formatted = format(88415345000157) // 88.415.345/0001-57

// Generation
const generated = generate(); // randomly generated, valid CNPJ

License

MIT License Β© Gabriel Silva