This product was not featured by Product Hunt yet. It will not be visible on their landing page and won't be ranked (cannot win product of the day regardless of upvotes).
Product upvotes vs the next 3
Waiting for data. Loading
Product comments vs the next 3
Waiting for data. Loading
Product upvote speed vs the next 3
Waiting for data. Loading
Product upvotes and comments
Waiting for data. Loading
Product vs the next 3
Loading
@tadashi/mask
Tiny input masking for TS/JS — no dependencies
@tadashi/mask is a single-file, dependency-free ESM library for input masking in the browser — phone numbers, CPF/CNPJ, currency, credit cards. ~1KB min+gzip, native TypeScript types (JSDoc-generated), and a pure `Mask.core()` function that works without the DOM too.
Hey Product Hunt
I built @tadashi/mask because every time I needed a masked input, I ended up installing a library that pulled in a parser, a runtime, and a handful of transitive dependencies — just to reformat a string as someone types.
Masking is really a small problem: take the pattern (`999.999.999-99`, `(99) 9-9999-9999`), walk it against the input, reinsert literals. So the library stays that small too — single file, zero dependencies, ~1KB min+gzip.
A few things I focused on:
- `Mask.core(value, mask)` — a pure function, works without a DOM (Node.js included)
- Native TypeScript support — types generated straight from JSDoc, no separate `@types` package to install or fall out of sync
- Handles the real edge cases: switching CPF → CNPJ mid-typing, applying on blur vs. every keystroke, reading the pattern from a `data-mask` attribute
Live demo: https://codepen.io/lagden/pen/Xz...
Source: https://github.com/lagden/mask
npm: https://www.npmjs.com/package/@t...
Would love feedback — especially if you've hit friction with existing masking libraries and what would make this one better for you.
About @tadashi/mask on Product Hunt
“Tiny input masking for TS/JS — no dependencies”
@tadashi/mask was submitted on Product Hunt and earned 2 upvotes and 1 comments, placing #155 on the daily leaderboard. @tadashi/mask is a single-file, dependency-free ESM library for input masking in the browser — phone numbers, CPF/CNPJ, currency, credit cards. ~1KB min+gzip, native TypeScript types (JSDoc-generated), and a pure `Mask.core()` function that works without the DOM too.
On the analytics side, @tadashi/mask competes within Open Source, Developer Tools and GitHub — topics that collectively have 629.2k followers on Product Hunt. The dashboard above tracks how @tadashi/mask performed against the three products that launched closest to it on the same day.
Who hunted @tadashi/mask?
@tadashi/mask was hunted by Thiago Magalhães. A “hunter” on Product Hunt is the community member who submits a product to the platform — uploading the images, the link, and tagging the makers behind it. Hunters typically write the first comment explaining why a product is worth attention, and their followers are notified the moment they post. Around 79% of featured launches on Product Hunt are self-hunted by their makers, but a well-known hunter still acts as a signal of quality to the rest of the community. See the full all-time top hunters leaderboard to discover who is shaping the Product Hunt ecosystem.
For a complete overview of @tadashi/mask including community comment highlights and product details, visit the product overview.