Coverup.js

Conceals a string by converting characters to asterisks (or any other character). Works well for masking credit card numbers, API keys, or any other sensitive info you don't want to show in its entirety. Works in Node.js and browsers.
Note: This library doesn't keep your info secure, it simply prevents users from seeing an entire string when it is displayed. Please make sure you take the correct precautions when dealing with sensitive info in your app.
How to Use
npm install coverup --save
var coverup = require('coverup')
coverup('4242-4242-4242-4242')
coverup('4242-4242-4242-4242', { char: '%' })
coverup('4242-4242-4242-4242', { keepSymbols: true })
coverup('4242-4242-4242-4242', { keepLeft: 1, keepRight: 1, compactTo: 4 })
coverup('4242-4242-4242-4242', { keepLeft: 4 })
coverup('4242-4242-4242-4242', { keepRight: 4 })
UMD
You can also access the UMD version by using unpkg. This will create Coverup
as a global.
<script src="https://unpkg.com/coverup/coverup.min.js"></script>
<script> Coverup('secret') </script>
API
coverup (value, options)
License
MIT © Jason Maurer