MCPcopy Index your code
hub / github.com/bytecodealliance/ComponentizeJS / prepWorkDir

Function prepWorkDir

src/componentize.js:516–530  ·  view source on GitHub ↗

Prepare a work directory for use with componentization

()

Source from the content-addressed store, hash-verified

514
515/** Prepare a work directory for use with componentization */
516async function prepWorkDir() {
517 const baseDir = maybeWindowsPath(
518 join(
519 tmpdir(),
520 createHash('sha256')
521 .update(Math.random().toString())
522 .digest('hex')
523 .slice(0, 12),
524 ),
525 );
526 await mkdir(baseDir);
527 const sourcesDir = maybeWindowsPath(join(baseDir, 'sources'));
528 await mkdir(sourcesDir);
529 return { baseDir, sourcesDir };
530}
531
532/**
533 * Initialize a WebAssembly binary, given the

Callers 1

componentizeFunction · 0.85

Calls 1

maybeWindowsPathFunction · 0.90

Tested by

no test coverage detected