summary refs log tree commit diff
path: root/src/util/secretUtils.js
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-05-29 22:28:19 +0200
committerRory& <root@rory.gay>2025-05-29 22:28:19 +0200
commita089651693cf6912864a6589de0f7aad911a8b83 (patch)
treebd3d229b1c5891a40709ff34e3f7fb17d654a142 /src/util/secretUtils.js
parentAllow unfree in nix flake, add mongodb-compass to devShell closure, basic mon... (diff)
downloadnodejs-final-assignment-a089651693cf6912864a6589de0f7aad911a8b83.tar.xz
Get database working
Diffstat (limited to 'src/util/secretUtils.js')
-rw-r--r--src/util/secretUtils.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util/secretUtils.js b/src/util/secretUtils.js
new file mode 100644

index 0000000..33e5fef --- /dev/null +++ b/src/util/secretUtils.js
@@ -0,0 +1,9 @@ +import fs from "node:fs/promises"; + +export async function readSecret(path) { + if (!path) { + throw new Error("Path to secret file is required"); + } + const content = await fs.readFile(path, "utf8"); + return content.trim(); +}