happy-opfs
    Preparing search index...

    Function pruneTemp

    • Removes expired files from the temporary directory. Only removes direct children files whose lastModified time is before the specified date.

      Note: This function only removes files directly under /tmp, not subdirectories or their contents. Use deleteTemp() to remove the entire temporary directory including all nested content.

      Parameters

      • expired: Date

        Files modified before this date will be deleted.

      Returns AsyncVoidIOResult

      A promise that resolves to an AsyncVoidIOResult indicating success or failure.

      1.7.0

      // Remove files older than 24 hours
      const yesterday = new Date(Date.now() - 24 * 60 * 60 * 1000);
      const result = await pruneTemp(yesterday);