happy-opfs
    Preparing search index...

    Function mkTemp

    • Creates a temporary file or directory in the /tmp directory. Uses crypto.randomUUID() to generate a unique name.

      Parameters

      • Optionaloptions: TempOptions

        Options for creating the temporary path.

      Returns AsyncIOResult<string>

      A promise that resolves to an AsyncIOResult containing the created path.

      1.7.0

      // Create a temporary file
      (await mkTemp())
      .inspect(path => console.log(path)); // '/tmp/tmp-550e8400-e29b-41d4-a716-446655440000'

      // Create a temporary directory
      await mkTemp({ isDirectory: true });

      // Create with custom basename and extension
      await mkTemp({ basename: 'cache', extname: '.json' });