MCPcopy Index your code
hub / github.com/Sandpack/nodebox-runtime / writeWorker

Function writeWorker

internals/esbuild-plugins/inline-worker.ts:16–20  ·  view source on GitHub ↗
(dirname: string, content: string)

Source from the content-addressed store, hash-verified

14}
15
16export async function writeWorker(dirname: string, content: string): Promise<string> {
17 const filename = `worker-${hashString(content)}.js`;
18 await fs.writeFile(path.join(dirname, filename), content, 'utf-8');
19 return filename;
20}
21
22const existingBundles = new Map<string, string>();
23const existingReplaces = new Map<string, string>();

Callers 1

setupFunction · 0.85

Calls 2

hashStringFunction · 0.85
writeFileMethod · 0.80

Tested by

no test coverage detected