easy-cpf

1.2.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i easy-cpf

Weekly Downloads

10

Version

1.2.0

License

ISC

Unpacked Size

6.9 kB

Total Files

8

Last publish

Collaborators

  • daniellvaz