MCPcopy Index your code
hub / github.com/ds300/patch-package / getAppRootPath

Function getAppRootPath

src/getAppRootPath.ts:5–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { existsSync } from "fs-extra"
4
5export const getAppRootPath = (): string => {
6 let cwd = process.cwd()
7 while (!existsSync(join(cwd, "package.json"))) {
8 const up = resolve(cwd, "../")
9 if (up === cwd) {
10 throw new Error("no package.json found for this project")
11 }
12 cwd = up
13 }
14 return cwd
15}

Callers 1

index.tsFile · 0.90

Calls 2

joinFunction · 0.90
resolveFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…