Socket
Book a DemoInstallSign in
Socket

just-phone-mask

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

just-phone-mask

Simple and easy phone number input mask plugin

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

JustPhoneMask v1.0.0

Simple and easy phone number input mask plugin

Overview

  • No dependencies.
    Written in pure JavaScript — no additional libraries required.

  • Simplicity and functionality.
    Easily integrate and use the plugin to enforce phone number masking.

Installation

  • Download the library just-phone-mask.min.js from the dist folder.
    Alternatively, install via NPM:
npm i just-phone-mask
  • Include it in your project:
  <script src="just-phone-mask.min.js"></script>

Or (for module bundlers):

import JustPhoneMask from 'just-phone-mask';
  • Initialize the library:
new JustPhoneMask();

Methods & Properties

The library supports the following configuration options:

new JustPhoneMask( {
  countryCode: '+7',
  bodyMask: ' ___ ___ __ __',
  setPlaceholder: false,
  selectors: null,
} )

Properties

  • countryCode

Sets the country code (default: +7). Example:

new JustPhoneMask( {
  countryCode: '+375'
} )
  • bodyMask

Defines the input mask body. The _ character acts as a placeholder. The full mask combines the country code and body mask (spaces, brackets, hyphens, etc. are allowed) (default: ___ ___ __ __). Example:

new JustPhoneMask( {
  bodyMask: ' (___) __ ___ __-__',
} )
  • setPlaceholder

Toggles whether to display the mask as the input’s placeholder (default: false). Example:

new JustPhoneMask( {
  setPlaceholder: true,
} )
  • selectors

Specifies CSS selectors for target elements (uses querySelectorAll) (default: [type="tel"]). Example:

new JustPhoneMask( {
  selectors: '.class',
} )

Keywords

phone-mask

FAQs

Package last updated on 06 May 2025

Did you know?

Socket

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.

Install

Related posts