Skip to content

tiagoporto/gerador-validador-cpf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gerador e Validador de CPF Open Source Love

JS lib to generate and validate CPF (Cadastro de Pessoas Físicas) of Brazil.

NPM Version JSR Version

npm type definitions npm bundle size Downloads

📚 Docs

Read in other languages: English, Español e Português(Brasil)

✅ Status

Docs GA Workflow Status Checks GA Workflow Status Tests GA Workflow Status E2E Tests GA Workflow Status

Website W3C Validation

Coverage Status mutation score

🧰 Stack

node nvm pnpm vs code

git Conventional Commits Semantic Release

TypeScript React i18next Sass ejs PostCSS Autoprefixer CSS Modules PWA Browserslist

Webpack SWC Rollup Jest Cypress Stryker

EditorConfig Prettier Eslint Stylelint Remark Husky Lint Staged Commitlint

Coveralls Dependabot GitHub Actions GitHub Pages

🎮 Playground

https://tiagoporto.github.io/gerador-validador-cpf/

📦 Installation

Install with npm:

npm install gerador-validador-cpf

Install with deno(jsr):

deno add jsr:@tiagoporto/gerador-validador-cpf

➡️ Usage

Generate CPF

import { generate as generateCpf } from 'gerador-validador-cpf'
// jsr import from "@tiagoporto/gerador-validador-cpf"

const cpf = generateCpf()
console.log(cpf) // 00000000000

const formattedCpf = generateCpf({ format: true })
console.log(formattedCpf) // 000.000.000-00

Validate CPF

import { validate as validadeCpf } from 'gerador-validador-cpf'
// jsr import from "@tiagoporto/gerador-validador-cpf"

const isCpfValid = validadeCpf('12345678900')
const isFormattedCpfValid = validadeCpf('123.456.789-00')

🛠 Development

Pre-requirements

Install node

nvm install

Install pnpm

corepack enable pnpm

Install

pnpm install

Running dev server

pnpm start

🤝 Contributing

Check how to contribute.

🤜🤛 Donating

This project is developed on my free time, any donation is welcome.

GITHUB Sponsor Paypal Donate Bitcoin

📄 License

This project is licensed under the MIT License.