New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cpf_and_cnpj-generator

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cpf_and_cnpj-generator - npm Package Compare versions

Comparing version

to
1.2.4

2

package.json
{
"name": "cpf_and_cnpj-generator",
"version": "1.2.3",
"version": "1.2.4",
"description": "This repository contains a JavaScript code that generates a valid Brazilian CPF (Cadastro de Pessoas Físicas). CPF is a unique identification number assigned to individuals in Brazil. The code ensures that the generated CPF numbers follow the required validation rules and algorithms.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -1,2 +0,2 @@

# CPF and CNPJ Generator / Gerador de CPF e CNPJ
# Gerador de CPF e CNPJ

@@ -7,92 +7,2 @@ [![npm version](https://badge.fury.io/js/cpf_and_cnpj-generator.svg?refresh=5)](https://badge.fury.io/js/cpf_and_cnpj-generator)

If you want to help me, you can buy me a coffee (:
<p align="center">
<a href="https://www.buymeacoffee.com/gabriellogan" target="_blank">
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 35px !important;width: 180px !important;" >
</a>
</p>
## English
This npm package provides JavaScript functions to generate valid Brazilian CPF (Cadastro de Pessoas Físicas) and CNPJ (Cadastro Nacional da Pessoa Jurídica) numbers.
## CDN
unpkg:
```bash
https://unpkg.com/cpf_and_cnpj-generator@1.2.3/dist/bundle.js
```
```html
<script src="https://unpkg.com/cpf_and_cnpj-generator@1.2.3/dist/bundle.js"></script>
```
jsdelivr:
```bash
https://cdn.jsdelivr.net/npm/cpf_and_cnpj-generator@1.2.3/+esm
```
```html
<script type="module">
import {
generateCpf,
generateCnpj,
} from "https://cdn.jsdelivr.net/npm/cpf_and_cnpj-generator@1.2.3/+esm";
</script>
```
### Installation
You can install this package using npm:
```bash
npm install cpf_and_cnpj-generator
```
```bash
yarn add cpf_and_cnpj-generator
```
```bash
pnpm add cpf_and_cnpj-generator
```
How to Use
After installing the package, you can use it in your JavaScript project:
```javascript
// Using import
import generator from "cpf_and_cnpj-generator";
console.log(generator.generateCnpj());
console.log(generator.generateCpf());
// Or
import { generateCnpj, generateCpf } from "cpf_and_cnpj-generator";
console.log(generateCnpj());
console.log(generateCpf());
// Using require
const generator = require("cpf_and_cnpj-generator");
console.log("CPF generated:", generator.generateCnpj());
console.log("CNPJ generated:", generator.generateCpf());
// Or
const { generateCpf, generateCnpj } = require("cpf_and_cnpj-generator");
console.log("CPF generated:", generateCnpj());
console.log("CNPJ generated:", generateCpf());
```
Keep in mind that the code to import or require depends on the JavaScript environment you're running the package in (for example, Node.js with or without ES module support). Therefore, choose the import or require option that suits your environment.
##########################################################################################
Português
Este pacote npm fornece funções em JavaScript para gerar números válidos de CPF (Cadastro de Pessoas Físicas) e CNPJ (Cadastro Nacional da Pessoa Jurídica) para o Brasil.

@@ -109,7 +19,7 @@

```bash
https://unpkg.com/cpf_and_cnpj-generator@1.2.3/dist/bundle.js
https://unpkg.com/cpf_and_cnpj-generator@1.2.4/dist/bundle.js
```
```html
<script src="https://unpkg.com/cpf_and_cnpj-generator@1.2.3/dist/bundle.js"></script>
<script src="https://unpkg.com/cpf_and_cnpj-generator@1.2.4/dist/bundle.js"></script>
```

@@ -120,3 +30,3 @@

```bash
https://cdn.jsdelivr.net/npm/cpf_and_cnpj-generator@1.2.3/+esm
https://cdn.jsdelivr.net/npm/cpf_and_cnpj-generator@1.2.4/+esm
```

@@ -129,3 +39,3 @@

generateCnpj,
} from "https://cdn.jsdelivr.net/npm/cpf_and_cnpj-generator@1.2.3/+esm";
} from "https://cdn.jsdelivr.net/npm/cpf_and_cnpj-generator@1.2.4/+esm";
</script>

@@ -152,6 +62,7 @@ ```

Após instalar o pacote, você pode utilizá-lo em seu projeto JavaScript:
Após instalar o pacote, você pode utilizá-lo em seu projeto JavaScript/TypeScript:
### ES Modules
```javascript
// Usando import
import gerador from "cpf_and_cnpj-generator";

@@ -161,4 +72,5 @@

console.log(gerador.generateCpf());
```
// Ou
```javascript
import { generateCnpj, generateCpf } from "cpf_and_cnpj-generator";

@@ -168,4 +80,7 @@

console.log(generateCpf());
```
// Usando require
### CommonJS
```javascript
const gerador = require("cpf_and_cnpj-generator");

@@ -175,4 +90,5 @@

console.log("CNPJ Gerado:", gerador.generateCpf());
```
// Ou
```javascript
const { generateCpf, generateCnpj } = require("cpf_and_cnpj-generator");

@@ -179,0 +95,0 @@