Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabeidx/cnpj
🇧🇷 Format, validate and generate CNPJ numbers in Node & Deno
https://github.com/gabeidx/cnpj
brasil brazil cnpj cnpj-numbers cnpj-validator deno denoland generation node nodejs validation
Last synced: about 3 hours ago
JSON representation
🇧🇷 Format, validate and generate CNPJ numbers in Node & Deno
- Host: GitHub
- URL: https://github.com/gabeidx/cnpj
- Owner: gabeidx
- License: mit
- Created: 2017-08-30T21:57:41.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-07-29T21:30:56.000Z (6 months ago)
- Last Synced: 2025-01-28T11:05:07.218Z (5 days 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: 2
- Forks: 1
- Open Issues: 0
-
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)