Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
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.
❤️ 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 115,307 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 1 open source maintainer 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.