person_registration
v0.1.2
Published
Person registration for Brazil documents
Readme
Person Registration
Overview
Person Registration is a powerful tool designed to simplify the generation of realistic Brazilian identification documents for testing purposes. Whether you're working with physical person (CPF) or juridical person (CNPJ) registrations, this library provides an easy-to-use CLI and API for Rust and Node.js projects.
Use this tool to simulate scenarios like creating test users, validating systems, or integrating third-party services. Contributions are welcome to expand its functionality!
Features
- Generate CPF and CNPJ numbers: Quickly produce valid-looking Brazilian documents for testing.
- Flexible usage: Use as a CLI tool or integrate directly into your Rust or Node.js application.
- Cross-language support: Works seamlessly with Rust and Node.js.
Installation
For Rust
Install globally using Cargo:
cargo install person_registrationOr add it as a dependency to your project:
[dependencies]
person_registration = "*"For Node.js
Install via npm or yarn:
npm install person-registrationyarn add person-registrationUsage
CLI
Physical Person (CPF)
Generate 5 CPF numbers:
person_registration --physical 5Juridical Person (CNPJ)
Generate 5 CNPJ numbers:
person_registration --juridic 5Mixed Mode
Generate a mix of CPF and CNPJ numbers:
person_registration --misc 5Rust API
Add the Library
Include person_registration in your Rust project as shown in the installation section.
Example Usage
use person_registration::{Gen, Person, Juridic};
fn main() {
let cpf = Person::generate();
let cnpj = Juridic::generate();
println!("Generated CPF: {}", cpf);
println!("Generated CNPJ: {}", cnpj);
}Node.js API
Import the Module
After installing via npm or yarn, import it into your project:
const { genPhysical, genJuridic } = require('person_registration');
// Generate a single CPF
console.log("Generated CPF:", genPhysical(10));
// Generate a single CNPJ
console.log("Generated CNPJ:", genJuridic(5));Contributing
We welcome contributions from the community! If you'd like to improve this tool, feel free to:
- Fork the repository.
- Create a branch for your feature (
feature/my-new-feature). - Submit a pull request with a clear description of your changes.
License
This project is open-source and licensed under the MIT License.
Enjoy using Person Registration and feel free to suggest new features or report issues! 🚀
