readSecrets
import { readSecrets } from "https://git.sr.ht/~ruivieira/deno-experiments/blob/master/misc/secrets.ts";
Reads secrets from a JSON file from ~/.config/<topic>/<file>
.
As an example, const s = readSecrets<any>("myapp", "keys.json")
will
read the values into a JSON object from ~/.config/myapp/keys.json
.
The values can then be extracted with s.key1
, s.key2
, etc.
function readSecrets<T>(topic: string, file?): T;