summary refs log tree commit diff
path: root/src/utils.ts
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-10-13 23:31:53 +0200
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2019-10-13 23:31:53 +0200
commit0ccea881106946b66d167eee0ec8116ae4e3019e (patch)
treef5bdf7501d97cf31a767ed91335145530db4f49d /src/utils.ts
parent241ceeba4ad203b1e0711490344e970a3a452d07 (diff)
downloadkronikarz-0ccea881106946b66d167eee0ec8116ae4e3019e.tar.gz
kronikarz-0ccea881106946b66d167eee0ec8116ae4e3019e.zip
Add parsePost
Diffstat (limited to 'src/utils.ts')
-rw-r--r--src/utils.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils.ts b/src/utils.ts
new file mode 100644
index 0000000..23a3947
--- /dev/null
+++ b/src/utils.ts
@@ -0,0 +1,9 @@
+import * as fs from "fs";
+
+export function readDir(path: string): Array<string> {
+  if (fs.existsSync(path)) {
+    return fs.readdirSync(path);
+  } else {
+    throw `Path "${path}" doesn't exist`;
+  }
+}