diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-10-13 23:31:53 +0200 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2019-10-13 23:31:53 +0200 |
commit | 0ccea881106946b66d167eee0ec8116ae4e3019e (patch) | |
tree | f5bdf7501d97cf31a767ed91335145530db4f49d /src/utils.ts | |
parent | 241ceeba4ad203b1e0711490344e970a3a452d07 (diff) | |
download | kronikarz-0ccea881106946b66d167eee0ec8116ae4e3019e.tar.gz kronikarz-0ccea881106946b66d167eee0ec8116ae4e3019e.zip |
Add parsePost
Diffstat (limited to 'src/utils.ts')
-rw-r--r-- | src/utils.ts | 9 |
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`; + } +} |