MCPcopy Index your code
hub / github.com/anomalyco/opencode / npmVersion

Function npmVersion

packages/opencode/src/plugin/meta.ts:74–81  ·  view source on GitHub ↗
(target: string)

Source from the content-addressed store, hash-verified

72}
73
74async function npmVersion(target: string) {
75 const resolved = resolvedTarget(target)
76 const stat = await Filesystem.statAsync(resolved)
77 const dir = stat?.isDirectory() ? resolved : path.dirname(resolved)
78 return Filesystem.readJson<{ version?: string }>(path.join(dir, "package.json"))
79 .then((item) => item.version)
80 .catch(() => undefined)
81}
82
83async function entryCore(item: Touch): Promise<Core> {
84 const spec = item.spec

Callers 1

entryCoreFunction · 0.85

Calls 1

resolvedTargetFunction · 0.85

Tested by

no test coverage detected