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).
@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.
No comment highlights available yet. Please check back later!
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.
@tadashi/mask was featured in Open Source (68.8k followers), Developer Tools (519k followers) and GitHub (41.4k followers) on Product Hunt. Together, these topics include over 126.7k products, making this a competitive space to launch in.
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.
Want to see how @tadashi/mask stacked up against nearby launches in real time? Check out the live launch dashboard for upvote speed charts, proximity comparisons, and more analytics.