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

Function writePackage

packages/core/test/npm.test.ts:12–19  ·  view source on GitHub ↗
(dir: string, pkg: Record<string, unknown>)

Source from the content-addressed store, hash-verified

10const win = process.platform === "win32"
11
12const writePackage = (dir: string, pkg: Record<string, unknown>) =>
13 Bun.write(
14 path.join(dir, "package.json"),
15 JSON.stringify({
16 version: "1.0.0",
17 ...pkg,
18 }),
19 )
20
21const npmLayer = (cache: string) =>
22 AppNodeBuilder.build(Npm.node, [[Global.node, Global.layerWith({ cache, state: path.join(cache, "state") })]])

Callers 1

npm.test.tsFile · 0.85

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected