Hide any text without visible changes inside HTML DOM Node and get it back when needed.
npm i -D secret-text
import secretText from "secret-text"
//insert secret string inside existing DOM element
let div = document.querySelector("div")
div.innerHTML += secretText.makeSecretText("hello world!")
//get secret string from existing DOM element
let originalStr = secretText.getSecretText(div.innerHTML) // 'hello world!'
Method | Argument Type | Return Type | Description |
---|---|---|---|
makeSecretText( text ) | string | string | Returns secret text encrypted with non-printable symbols. |
getSecretText( text ) | string | string | Returns secret text from received text. |