This is content converted from Markdown!
Here's a JSON sample:
{
"foo": "bar"
}
<html> | |
<head> | |
<style> | |
h1 { | |
font-family: Calibri; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Hello World!</h1> |
// Node version 12.0 | |
// Typescript version 3.8 | |
import fs from "fs"; | |
import path from "path"; | |
const getAppRoot = (curPath: string, rootIndicator = 'package.json'): string | Error=> { | |
if (curPath.length === 0 || curPath === path.sep) { | |
throw new Error(`Couldn't find root dir`) | |
} else if (fs.existsSync(path.join(curPath, rootIndicator))) { | |
return curPath |