Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Simple zero-dependency input mask for Vanilla JS, Vue, Alpine.js and Svelte
Maska is a lightweight JavaScript library for input masking. It allows you to format user input in real-time, ensuring that the data entered matches a specified pattern. This is particularly useful for forms that require specific formats, such as phone numbers, dates, and credit card numbers.
Basic Masking
This feature allows you to apply a basic mask to an input field. In this example, the input field with the id 'phone' will be formatted as a US phone number.
const input = document.querySelector('#phone');
Maska.create(input, { mask: '(###) ###-####' });
Dynamic Masking
This feature allows you to apply a dynamic mask to an input field. In this example, the input field with the id 'date' will be formatted as a date in the format MM/DD/YYYY.
const input = document.querySelector('#date');
Maska.create(input, { mask: '##/##/####' });
Custom Placeholders
This feature allows you to use custom placeholders in your masks. In this example, the input field with the id 'custom' will be formatted as a credit card number with 'X' as the placeholder.
const input = document.querySelector('#custom');
Maska.create(input, { mask: '####-####-####-####', placeholder: 'X' });
Inputmask is a JavaScript library that creates an input mask. Inputmask can run against vanilla JavaScript, jQuery, and jqlite. It is more feature-rich compared to Maska, offering a wide range of options for different types of input masks, including numeric, date, and regex-based masks.
Cleave.js is a JavaScript library for formatting input text content when you are typing. It offers a variety of formatting options, including credit card numbers, phone numbers, dates, and numeral formatting. Cleave.js is similar to Maska but provides more advanced formatting options and better support for different locales.
Vanilla Text Mask is a pure JavaScript input mask library. It works with vanilla JavaScript and also has integrations for React, Angular, and Vue. It is similar to Maska in terms of functionality but offers more flexibility and integration options with modern JavaScript frameworks.
Simple zero-dependency input mask.
Maska v3 is currently in beta. If you encounter any issues, please report them.
❤️ Please support Maska development!
FAQs
Simple zero-dependency input mask for Vanilla JS, Vue, Alpine.js and Svelte
The npm package maska receives a total of 123,423 weekly downloads. As such, maska popularity was classified as popular.
We found that maska demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.