rollup-plugin-vault
v1.0.0
Published
Encrypts text to be decrypted at runtime
Downloads
5
Readme
rollup-plugin-vault
🔒 Encrypts text at build time, to be decrypted at runtime 🔒
Install
Using npm:
npm install rollup-plugin-vault --save-dev
Usage
Create a rollup.config.js
configuration file and import the plugin:
import vault from "rollup-plugin-vault";
export default {
input: "src/index.ts",
plugins: [vault("answers.json")],
};
And in index.ts
import checksum from "virtual:checksum-first-vault-entry";
checksum.check("Incorrect").catch((e) => console.log("Did not work"));
checksum.check("secret").then((v) => console.log("Decrypted", v));
with an answers.json
{
"first-vault-entry": {
"key": "secret",
"result": "This is the decrypted cleartext"
}
}