https://github.com/gabeins/cnpj
🇧🇷 Format, validate and generate CNPJ numbers in Node & Deno
https://github.com/gabeins/cnpj
brasil brazil cnpj cnpj-numbers cnpj-validator deno denoland generation node nodejs validation
Last synced: about 1 month ago
JSON representation
🇧🇷 Format, validate and generate CNPJ numbers in Node & Deno
- Host: GitHub
- URL: https://github.com/gabeins/cnpj
- Owner: gabeins
- License: mit
- Created: 2017-08-30T21:57:41.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2024-07-29T21:30:56.000Z (over 1 year ago)
- Last Synced: 2025-10-20T18:35:21.276Z (3 months ago)
- Topics: brasil, brazil, cnpj, cnpj-numbers, cnpj-validator, deno, denoland, generation, node, nodejs, validation
- Language: TypeScript
- Homepage: https://jsr.io/@brazil/cnpj
- Size: 493 KB
- Stars: 29
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# CNPJ
Format, validate and generate CNPJ numbers.
## Installation
### Node
```bash
npm install cnpj
```
or, if you are using jsr
```bash
npx jsr add @brazil/cnpj
```
```ts
import { validate, format, generate } from 'cnpj';
```
### Deno
```bash
deno add @brazil/cnpj
```
```ts
import { validate, format, generate } from '@brazil/cnpj';
```
## Usage
```js
// 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](https://gabrielizaias.mit-license.org) © [Gabriel Silva](https://gabe.id)