@andrejunqueira/simple_simple_mask
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

SimpleSimpleMask

This is a simple simple mask using pure js to apply in any string text you want !

Installation

Use yarn or npm.

yarn add @andrejunqueira/simple_simple_mask

OR

npm install @andrejunqueira/simple_simple_mask

Usage

import { makeMask } from '@andrejunqueira/simple_simple_mask';

const phone = "+# ### ### ####";
const phoneMask = makeMask(phone);
const maskedPhone = phoneMask("19998887777");

console.log(maskedPhone);

# it will log +1 999 888 7777

# in addition you can set the mask character

const date = "$$$$-$$-$$";
const dateMask = makeMask(phone, "$");
const dateMasked = dateMask("20231204");

# it will log 2023-12-04

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Package Sidebar

Install

npm i @andrejunqueira/simple_simple_mask

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

4.99 kB

Total Files

12

Last publish

Collaborators

  • andrejunqueira