1.0.13 • Published 2 years ago

simple-mask v1.0.13

Weekly downloads
-
License
ISC
Repository
-
Last release
2 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

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago