1.0.0 ā€¢ Published 1 year ago

rollup-plugin-vault v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

npm size

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"
  }
}

Then call rollup either via the CLI or the API.

1.0.0

1 year ago