
Stop Leaking Names Like It’s Harmless
Masking emails? Obvious. Tokens? Critical. But names? Somehow they always sneak into logs, dashboards, exports—fully visible like it’s no big deal. Until it is . Names are still personal data, and once they’re everywhere, good luck cleaning that up. That’s exactly where mask-name comes in: a tiny, zero-dependency utility to mask names properly across Latin and CJK (Chinese/Japanese) scripts , without breaking readability or context. 1. Basic usage (Latin names) import { maskName } from " @ekaone/mask-name " ; maskName ( " Eka Prasetia " ); // → { masked: "E*a P*****ia", script: "latin", original: "Eka Prasetia" } You still recognize the person. You just don’t expose the full name to the world. That’s the sweet spot. 2. CJK support (this is where it gets interesting) maskName ( " 张伟 " ); // → { masked: "张*", script: "cjk", original: "张伟" } maskName ( " 田中さくら " , { locale : " ja " }); // → { masked: "田**くら", script: "cjk", original: "田中さくら" } No hacks, no weird splitting logic. It unders
Continue reading on Dev.to JavaScript
Opens in a new tab

