diff options
Diffstat (limited to 'src/helper/get-file-contents.ts')
| -rw-r--r-- | src/helper/get-file-contents.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/helper/get-file-contents.ts b/src/helper/get-file-contents.ts new file mode 100644 index 0000000..a159f95 --- /dev/null +++ b/src/helper/get-file-contents.ts @@ -0,0 +1,14 @@ + + + +/*** EXPORT ------------------------------------------- ***/ + +export default async(filePath: string) => { + const fileExists = await Deno.stat(filePath); + + if (!fileExists) + return ""; + + const content = await Deno.readTextFile(filePath); + return content; +} |
