Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/eduardovillao/masky-js
- Owner: eduardovillao
- License: mit
- Created: 2025-01-17T22:56:58.000Z (11 days ago)
- Default Branch: main
- Last Pushed: 2025-01-17T23:12:12.000Z (11 days ago)
- Last Synced: 2025-01-18T00:20:06.126Z (11 days ago)
- Topics: cpf-cnpj-validation, form-validation, input-mask, javascript, mask
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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/).