1.2.0 • Published 1 year ago

@rimiti/maskme v1.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
1 year ago

maskme

Build Status Coverage Status MIT license

Description

This module provide a powerful function to hide your sensible data with "lookbehind" regex.

Installation

$ npm install @rimiti/maskme --save

Using this module in other modules

import Maskme from '@rimiti/maskme';
const Maskme = require('@rimiti/maskme').default;

How to use it?

Keep 2 first and 2 last chars (default configuration: offsetLeft: 2, offsetRight: 2):

Maskme("4242424242424242");
// 42************42

Keep 4 first and 4 last chars and customize replacer:

Maskme("4242424242424242", {replaceBy: "x"});
// 42xxxxxxxxxxxx42

Kepp 2 last chars:

Maskme("4242424242424242", {offsetLeft: 0,});
// **************42

Keep 2 first chars:

Maskme("4242424242424242", {offsetRight: 0});
// 42**************

Hide all chars:

Maskme("4242424242424242", {offsetRight: 0, offsetLeft: 0});
// ****************

Keep 6 first and 5 last chars:

Maskme("4242424242424242", {offsetLeft: 6, offsetRight: 5});
// 424242*****24242

Hide nothing:

Maskme("4242424242424242", {offsetLeft: 30, offsetRight: 40});
// 4242424242424242

License

MIT © Dimitri DO BAIRRO

1.2.0

1 year ago

1.1.0

6 years ago

1.0.0

6 years ago

0.1.0

6 years ago