Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eduardovillao/masky-js

📦 Masky.js – A lightweight (2.3 KB) and flexible JavaScript library for input masking. Supports custom masks, prefixes, suffixes, and built-in CPF/CNPJ validation for forms.
https://github.com/eduardovillao/masky-js

cpf-cnpj-validation form-validation input-mask javascript mask

Last synced: 10 days ago
JSON representation

📦 Masky.js – A lightweight (2.3 KB) and flexible JavaScript library for input masking. Supports custom masks, prefixes, suffixes, and built-in CPF/CNPJ validation for forms.

Awesome Lists containing this project

README

        

# Masky.js

📦 **Masky.js** – A lightweight (2.3 KB) and flexible JavaScript library for input masking. Add custom masks, prefixes, suffixes, and built-in CPF/CNPJ validation seamlessly.

---

## Features
- **Ultra lightweight**: Only 2.3 KB (1.5 KB gzipped).
- **Customizable**: Supports prefixes, suffixes, and flexible masks.
- **Built-in validations**: CPF and CNPJ validation included.
- **Easy to use**: Works with simple `data-mask` attributes in any input field.
- **Vanilla JS**: No dependencies required.

---

## Usage

Simply add a data-mask attribute to your input fields:

```html

```

**Validating CPF/CNPJ**
You can enable built-in validation by adding data-mask-validation:

```html

```

## Example

```html

```

## Contributing
We welcome contributions! Fork the repository, create a branch, and open a pull request.

## License
This project is licensed under the [MIT License](https://mit-license.org/).