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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@wjunin/input-utils-pro

v1.0.6

Published

Validações avançadas de CPF/CNPJ/RG por estado, PIS, Luhn, Placas Mercosul, máscaras, filtros de digitação e integrações com jQuery Validate.

Readme


🧩 Sobre o pacote

@wjunin/input-utils-pro é um conjunto completo de utilitários avançados para entradas de dados em projetos brasileiros, incluindo:

  • Validações completas:
    • CPF, CNPJ, PIS
    • RG por estado (formatos oficiais)
    • Placas Mercosul e modelos antigos
    • Cartão de crédito (Luhn)
  • Bloqueio inteligente de digitação
  • Máscaras automáticas configuráveis
  • Integração com jQuery Validate
  • UMD, ESM e versão minificada
  • Testes unitários com QUnit

Ideal para formulários modernos, aplicações MVC, sistemas corporativos ou projetos SPA com jQuery/Bootstrap.


📦 Instalação

Via NPM

npm install @wjunin/input-utils-pro

VIA CDN (jsDelivr)
<script src="https://cdn.jsdelivr.net/npm/@wjunin/input-utils-pro/dist/input-utils.min.js"></script>

VIA CDN(unpkg)
<script src="https://unpkg.com/@wjunin/input-utils-pro/dist/input-utils.min.js"></script>


🚀 Como usar

1. Via UMD
<script src="input-utils.min.js"></script>
<script>
   InputUtils.validateCPF("123.456.789-09");
</script>

2. Via ES Modules
import { validateCPF, maskCPF } from "@wjunin/input-utils-pro";

console.log(validateCPF("123.456.789-09"));

3. Via jQuery
$("#cpf").on("input", function(){
    InputUtils.applyMaskCPF(this);
});

🎯 Exemplos de Uso
*Validação de CPF
InputUtils.validateCPF("123.456.789-09");
*Validação de CNPJ
InputUtils.validateCNPJ("12.345.678/0001-90");
*Validação de PIS
InputUtils.validatePIS("123.45678.90-1");
*Validação de RG por estado
InputUtils.validateRG("12.345.678-9", "SP");
*Validação de Placas
InputUtils.validatePlate("BRA2E19");
InputUtils.validatePlate("ABC-1234");
*Luhn (cartão)
InputUtils.validateLuhn("4539578763621486");


📝 Máscaras
InputUtils.applyMaskCPF(input);
InputUtils.applyMaskCNPJ(input);
InputUtils.applyMaskRG(input, "SP");
InputUtils.applyMaskPIS(input);
InputUtils.applyMaskPlate(input);


🔐 Bloqueio de digitação
*Apenas números
InputUtils.allowOnlyNumbers("#campo");
*Apenas letras
InputUtils.allowOnlyLetters("#nome");
*Regex customizado
InputUtils.allowPattern("#campo", /^[A-Z0-9]+$/);

🧩 jQuery Validate
$.validator.addMethod("cpf", v => InputUtils.validateCPF(v));

$("#form").validate({
   rules: { cpf: { cpf: true } },
   messages: { cpf: "Informe um CPF válido." }
});

🧪 Testes Unitários
test/test-build.html
Testa:
1º CPF
2º CNPJ
3º PIS
4º RG
5º Placas
6º Luhn

💼 Sobre o Autor

Wander Luz dos Santos Junior (wjunin)
Desenvolvedor Full Stack C#, especialista em validações, automações e ferramentas de produtividade.

📧 E-mail: [email protected]
💼 LinkedIn: https://linkedin.com/in/wander-luz-dos-santos-junior-445004103

🐙 GitHub: https://github.com/wjunin