@rimiti/maskme
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.0
    0
  • 1.1.0
    7
  • 1.0.0
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i @rimiti/maskme

Weekly Downloads

7

Version

1.2.0

License

MIT

Unpacked Size

5.81 kB

Total Files

5

Last publish

Collaborators

  • rimiti