npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mask-validation-br

v2.2.5

Published

Pacote de mascará e validação de CPF, CNPJ, CEP, Telefone, para avalização.

Downloads

260

Readme

Mask Validation BR

Mask Validation BR é uma biblioteca em Typescript leve e eficiente para mascaramento e validação de dados brasileiros. Inclui suporte para validação de números de celular, CPF, CNPJ e CEP, oferecendo também funcionalidades de formatação e validação regional de números de celular com base no DDD.

Recursos

  • Máscara e validação de celular (com validação de DDD)
  • Máscara e validação de CPF
  • Máscara e validação de CNPJ
  • Máscara e validação de CEP
  • Implementa o design pattern Strategy para flexibilidade nas validações
  • Sem dependências externas

Instalação

Instale a biblioteca via npm:

npm install mask-validation-br

Uso

import { Validator, Masker } from "mask-validation-br";

const CPF = '12345678909';
const CNPJ = '12345678000195'
const phoneNumber = '11987654321'
const CEP = '12345678'

Masker.cpf(CPF) // Saída: 123.456.789-09
Validator.cpf(CPF) // True or False

Masker.cnpj(CNPJ)
Validator.cnpj(CNPJ)

Masker.phone(phoneNumber)
Validator.phone(phoneNumber)

Masker.cep(CEP)
Validator.cep(CEP)

Teste por CLI

Uso: npx mask-validation-br tipo valor

Tipos suportados: celular, cpf, cnpj, cep

Ex

npx mask-validation-br cpf 12345678900

DDDs Listados

  • São Paulo: 11, 12, 13, 14, 15, 16, 17, 18, 19
  • Rio de Janeiro: 21, 22, 24
  • Espírito Santo: 27, 28
  • Minas Gerais: 31, 32, 33, 34, 35, 37, 38
  • Paraná: 41, 42, 43, 44, 45, 46
  • Santa Catarina: 47, 48, 49
  • Rio Grande do Sul: 51, 53, 54, 55
  • Distrito Federal: 61
  • Goiás: 62, 64
  • Tocantins: 63
  • Mato Grosso: 65, 66
  • Mato Grosso do Sul: 67
  • Acre: 68
  • Rondônia: 69
  • Bahia: 71, 73, 74, 75, 77
  • Sergipe: 79
  • Pernambuco e Alagoas: 81, 82
  • Paraíba: 83
  • Rio Grande do Norte: 84
  • Ceará: 85, 88
  • Piauí: 86, 89
  • Norte (Amazonas, Pará, etc.): 91, 92, 93, 94, 95, 96, 97, 98, 99

Licença

Este projeto está licenciado sob a MIT.

Contato

Sinta-se à vontade para entrar em contato: