
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
@signalapp/minimask
Advanced tools
A tiny & modern library for masking inputs.
npm install --save @signalapp/minimask
Setup an <input>:
<input
id="creditCardNumber"
type="text"
inputmode="numeric"
autocomplete="cc-number"
placeholder="1234 1234 1234 1234"
size="20"
/>
Create a formatter:
export function creditCardNumberFormatter(input) {
let tokens = []
let digits = 0
for (let [index, char] of input.split("").entries()) {
// skip non-digits
if (!/\d/.test(char)) {
continue
}
// push digits
tokens.push({ char, index, mask: false })
digits++
// insert spaces when needed
if (digits === 4 || digits === 8 || digits === 12) {
tokens.push({ char: " ", index, mask: true })
}
// ignore any additional chars
if (digits >= 16) {
break
}
}
return tokens
}
Attach the formatter to the input:
import { minimask } from "minimask"
import { creditCardNumberFormatter } from "./formatters"
let input = document.querySelector("#creditCardNumber")
minimask(input, formatter)
Copyright 2025 Signal Messenger, LLC
Licensed under the AGPLv3
FAQs
Simple HTML input masking
The npm package @signalapp/minimask receives a total of 0 weekly downloads. As such, @signalapp/minimask popularity was classified as not popular.
We found that @signalapp/minimask demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 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
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.