1.0.13 • Published 3 years ago

simple-mask v1.0.13

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Simple mask

This package used to mask input by string pattern

Installation

npm install simple-mask --save

Usage

import { mask } from 'simple-mask';

mask(input, {
	mask: '+7 *** *** ** **',
	replace: /\D/g,
});

Usage from CDN

<script src="https://cdn.jsdelivr.net/npm/simple-mask@latest/index.min.js"></script>
SimpleMask.mask(input, {
	mask: '+7 *** *** ** **',
	replace: /\D/g,
});

Options

mask : string

The masking pattern to be applied to the <input>.

maskSymbol : string

Symbol used in mask pattern which will replaced on input Default: '*'

replace : string | RegExp

Symbols to replace

replacement : string

Symbols which will insert instead Default: ''

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

4 years ago