1.2.0 • Published 1 year ago

easy-cpf v1.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Easy CPF

Easy cpf is a lightweight library for validating and generating CPF (Cadastro de Pessoas Físicas) numbers in TypeScript and JavaScript.

npm version License

Installation

You can install easy-cpf via npm or yarn:

npm install easy-cpf
# or
yarn add easy-cpf

Usage

Validator

const { cpf } = require("easy-cpf");

const cpf = "123.456.789-09";

// true or false
cpf.validate(cpf);

Generator

const { cpf } = require("easy-cpf");

const randomCPF = cpf.generate();

// 123.456.789-10
console.log("Random CPF:", randomCPF);

As number

const { cpf } = require("easy-cpf");

const randomCPF = cpf.generate("number");

//12345678910
console.log("Random CPF:", randomCPF);

Author

LinkedIn

X (Twitter)

Instagram

Website

Licenses

MIT

1.2.0

1 year ago

1.2.0-0

1 year ago

1.1.0

1 year ago