Htmask.js – The input masking library nobody asked for
Htmask.js – The input masking library nobody asked for
I built htmask.js because I was bored and all my input fields were embarrassingly unmasked. It's a dependency-free JavaScript library that does one thing: masks inputs. No npm bloat, no build step, no tests (yet). Just a script tag and some mask attributes: ```html <input mask="(00) 00000-0000"> <input mask="00/00/0000"> <input mask="AAA-0000"> ``` Where `0` = digit, `A` = letter, and everything else = "let's see what happens". I made this as a weekend boredom project because existing solutions required reading documentation, and I'm fundamentally opposed to that. It works with vanilla JS, plays nicely with htmx (shockingly), and has caused zero production incidents so far (sample size: 1). The code is probably terrible, the edge cases are definitely unhandled, but unformatted input is ugly and this library is… slightly less ugly. GitHub: https://github.com/DaviTostes/htmask Fair warning: Use at your own risk. Or better yet, don't use it at all. But if you do, let me know what breaks.
Share cardActual performance
Launch Intel predictions
Analyze your own launch →Correct prediction on native model
Similar products
HumanInput.js – A library for capturing human input
Input masking library
A monad transformer library in JS
Wiv.js – A library for a more wiggly div
Mechanic.js, a jQuery-esque UIAutomation library
JS Cohort Viz library
AreYouSure.js, the 2Kb library for saner confirmation dialogs
Superplaceholder.js – animated input placeholders
a companion library to underscore.js - f_underscore.js
A Simple JS Async iterator library