https://github.com/rimiti/maskme
🦹♀️ Replace sensitive string parts by asterisks (fully customizable).
https://github.com/rimiti/maskme
credit-card hidden hide mask node regex replace sensible
Last synced: about 2 months ago
JSON representation
🦹♀️ Replace sensitive string parts by asterisks (fully customizable).
- Host: GitHub
- URL: https://github.com/rimiti/maskme
- Owner: rimiti
- License: mit
- Created: 2018-06-08T09:15:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-25T08:34:10.000Z (about 3 years ago)
- Last Synced: 2025-10-26T00:16:18.579Z (7 months ago)
- Topics: credit-card, hidden, hide, mask, node, regex, replace, sensible
- Language: TypeScript
- Homepage: https://dimsolution.com
- Size: 121 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# maskme
[](https://travis-ci.org/rimiti/maskme.svg?branch=master)
[](https://coveralls.io/github/rimiti/maskme?branch=master)
[](http://opensource.org/licenses/MIT)
## 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
```js
import Maskme from '@rimiti/maskme';
```
```js
const Maskme = require('@rimiti/maskme').default;
```
## How to use it?
Keep 2 first and 2 last chars (default configuration: offsetLeft: 2, offsetRight: 2):
```js
Maskme("4242424242424242");
// 42************42
```
Keep 4 first and 4 last chars and customize replacer:
```js
Maskme("4242424242424242", {replaceBy: "x"});
// 42xxxxxxxxxxxx42
```
Kepp 2 last chars:
```js
Maskme("4242424242424242", {offsetLeft: 0,});
// **************42
```
Keep 2 first chars:
```js
Maskme("4242424242424242", {offsetRight: 0});
// 42**************
```
Hide all chars:
```js
Maskme("4242424242424242", {offsetRight: 0, offsetLeft: 0});
// ****************
```
Keep 6 first and 5 last chars:
```js
Maskme("4242424242424242", {offsetLeft: 6, offsetRight: 5});
// 424242*****24242
```
Hide nothing:
```js
Maskme("4242424242424242", {offsetLeft: 30, offsetRight: 40});
// 4242424242424242
```
## License
MIT © [Dimitri DO BAIRRO](https://github.com/rimiti/maskme/blob/master/LICENSE)