dir

tcmts.core.test.hash.dir · #ek3lv4p6 · term · runs on the server

uses node:fs

Where the tests write the files they analyze: an ES module package.

import fs from "node:fs";
import os from "node:os";
import path from "node:path";

export const dir = (() => {
  const d = fs.mkdtempSync(path.join(os.tmpdir(), "tcm-core-"));
  fs.writeFileSync(path.join(d, "package.json"), JSON.stringify({ type: "module" }));
  return d;
})()

used by