https://github.com/sergi/conceal
Conceals a string or part of it.
https://github.com/sergi/conceal
Last synced: 10 months ago
JSON representation
Conceals a string or part of it.
- Host: GitHub
- URL: https://github.com/sergi/conceal
- Owner: sergi
- Created: 2013-12-02T22:11:40.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-12-04T09:32:32.000Z (over 12 years ago)
- Last Synced: 2025-09-08T17:05:19.723Z (10 months ago)
- Language: JavaScript
- Size: 102 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://nodei.co/npm/conceal/)
Node.js module for obfuscating a string or a part of it. I've needed this functionality several
times now and I've decided to make a micro-module for it. It is useful to
conceal sensitive strings such as passwords, or parts of a string, e.g. a
credit card to show the user.
``` js
var conceal = require('conceal');
var str = 'Big Secret';
conceal(str);
// '**********'
conceal(str, { ch: '^' });
// '^^^^^^^^^^'
conceal(str, { start: 4, end: 6 });
// 'Big ***ret'
```
## Install
```
npm install conceal
```
## License
MIT
