Skip to content
/ maoli.js Public

JavaScript Helper library for common Brazilian business rules (CPF, CNPJ, and CEP).

License

Notifications You must be signed in to change notification settings

aueda/maoli.js

Repository files navigation

#Maoli.js

Join the chat at https://gitter.im/aueda/maoli.js

Build Status

Versão em português: LEIAME.md

Maoli.js is JavaScript helper library for common brazilian business rules (CEP, CPF and CNPJ).

Currently implements:

  • CEP validation
  • CPF validation
  • CNPJ validation

For .NET server-side validation of CEP, CPF and CNPJ, please see Maoli.

Documentation

Cep

Maoli.Cep.validate(cep) - checks if a string value is a valid CEP representation. Returns true if CEP string is valid; false otherwise.

	if (window.Maoli.Cep.validate("99999-999"))
	{
	    console.log("CEP is valid");
	}

Cpf

Maoli.Cpf.validate(cpf) - checks if a string value is a valid CPF representation. Returns true if CPF string is valid; false otherwise.

	if (window.Maoli.Cpf.validate("999.999.99-99"))
	{
	    console.log("CPF is valid");
	}

Cnpj

Maoli.Cnpj.validate(cnpj) - checks if a string value is a valid CNPJ representation. Returns true if CNPJ string is valid; false otherwise.

	if (window.Maoli.Cnpj.validate("99.999.999/9999-99"))
	{
	    console.log("CPNJ is valid");
	}

NuGet Package

To install Maoli.js using NuGet, run the following command in the Package Manager Console:

PM> Install-Package Maoli.js

npm Package

To install Maoli.js using npm, run the following command in the console:

PM> npm install maoli

Source Code

Source code is available at GitHub.

License

This project is licensed under the MIT License.

Author

Adriano Ueda @adriueda

About

JavaScript Helper library for common Brazilian business rules (CPF, CNPJ, and CEP).

Resources

License

Stars

Watchers

Forks

Packages

No packages published