
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
simple-input-mask
Advanced tools
This is a set of JavaScript functions for applying formatting masks to input fields.
This is a set of JavaScript functions for applying formatting masks to input fields.
| Function | Description |
|---|---|
prefixRealMask(this) | Adds the "R$" prefix and formats a numeric value as a Brazilian currency mask. |
RealMask(this) | Formats a numeric value as a Brazilian currency mask. |
cpfMask(this) | Formats a numeric value as a CPF (Individual Taxpayer Registration) mask. |
cnpjMask(this) | Formats a numeric value as a CNPJ (National Register of Legal Entities) mask. |
numberMask(this) | Removes all non-numeric characters from an input field. |
cellPhoneMask(this) | Formats a numeric value as a mobile number mask. |
phoneMask(this) | Formats a numeric value as a phone number mask. |
cepMask(this) | Formats a numeric value as a ZIP code (Postal Code) mask. |
inscricaoEstadualMask(this) | Formats a numeric value as a State Registration mask. |
To use these functions, you must pass a this event object that represents the input field. The functions will format the field value according to the corresponding mask.
Example of use:
<input type="text" oninput="cpfMask(this)" placeholder="CPF">
This example will apply the CPF mask to the input field.
Feel free to contribute with improvements, corrections or adding new skins. Open an issue or submit a pull request to discuss your ideas and contributions.
This code is licensed under the MIT License. See the LICENSE file for more information.
FAQs
This is a set of JavaScript functions for applying formatting masks to input fields.
The npm package simple-input-mask receives a total of 1 weekly downloads. As such, simple-input-mask popularity was classified as not popular.
We found that simple-input-mask 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 CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.