Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Small library to mask strings
$ npm install msk
const msk = require("msk");
msk("552122222222", "+99 (99) 9999-9999")
// "+55 (21) 2222-2222"
msk.fit("22231-0004131", "99999-999")
// "22231-000"
Returns a formatted string based on the mask prodived
Type: string
A string to apply the mask.
Type: string
A mask is formed based on the following symbols:
Symbol | Accepts |
---|---|
9 | Numbers ([0-9] ) |
A | Letters ([A-ú] ) |
S | Alphanumeric chars ([A-ú0-9] ) |
* | Anything |
other char | Specified char |
Returns a formatted string removing the exceeding characters.
msk("552122222222", "+99 (99) 9999-9999")
// "+55 (21) 2222-2222"
msk("V6G1C9", "A9A 9A9")
// "V6G 1C9"
msk("I love msk", "*-****-***")
// "I-love-msk"
msk.fit("22231-0004131", "99999-999")
// "22231-000"
MIT © VTEX
[1.0.5] - 2020-03-17
index.d.ts
in files
of package.json
.FAQs
Small library to mask strings
The npm package msk receives a total of 4,732 weekly downloads. As such, msk popularity was classified as popular.
We found that msk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.