2 files changed, 10 insertions, 0 deletions
diff --git a/src/util/index.js b/src/util/index.js
index e69de29..9a6c774 100644
--- a/src/util/index.js
+++ b/src/util/index.js
@@ -0,0 +1 @@
+export * from "./secretUtils.js";
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();
+}
|