1.0.0 ā¢ Published 1 year ago
rollup-plugin-vault v1.0.0
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"
}
}
1.0.0
1 year ago