happy-opfs
    Preparing search index...

    Function generateTempPath

    • Generates a unique temporary file or directory path without creating it. Uses crypto.randomUUID() to ensure uniqueness.

      Parameters

      • Optionaloptions: TempOptions

        Options for generating the temporary path.

      Returns string

      The generated temporary path string.

      1.7.0

      • mkTemp for creating the temporary file/directory
      • isTempPath for checking if a path is temporary
      generateTempPath();                           // '/tmp/tmp-550e8400-e29b-41d4-a716-446655440000'
      generateTempPath({ basename: 'cache' }); // '/tmp/cache-550e8400-e29b-41d4-a716-446655440000'
      generateTempPath({ extname: '.txt' }); // '/tmp/tmp-550e8400-e29b-41d4-a716-446655440000.txt'
      generateTempPath({ isDirectory: true }); // '/tmp/tmp-550e8400-e29b-41d4-a716-446655440000'