MCPcopy
hub / github.com/prettier/prettier / createTemporaryDirectory

Function createTemporaryDirectory

tests/config/install-prettier.js:37–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35 },
36 );
37const createTemporaryDirectory = () => {
38 const directory = path.join(
39 // The following quoted from https://github.com/es-tooling/module-replacements/blob/27d1acd38f19741e31d2eae561a5c8a914373fc5/docs/modules/tempy.md?plain=1#L20-L21, not sure if it's true
40 // MacOS and possibly some other platforms return a symlink from `os.tmpdir`.
41 // For some applications, this can cause problems; thus, we use `realpath`.
42 fs.realpathSync(os.tmpdir()),
43 crypto.randomBytes(16).toString("hex"),
44 );
45 fs.mkdirSync(directory);
46 return directory;
47};
48
49const allowedClients = new Set(["yarn", "npm", "pnpm"]);
50

Callers 1

installPrettierFunction · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…