happy-opfs
    Preparing search index...

    Function appendFile

    • Appends content to a file at the specified path. Creates the file if it doesn't exist (unless create: false is specified).

      Parameters

      • filePath: string

        The absolute path of the file to append to.

      • contents: WriteFileContent

        The content to append (string, ArrayBuffer, TypedArray, or Blob).

      • Optionaloptions: AppendOptions

        Optional append options.

        Options for appending to files.

        • Optionalcreate?: boolean

          Whether to create the file if it does not exist.

          true

      Returns AsyncVoidIOResult

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

      1.0.0

      writeFile with append: true option

      // Append to file, create if doesn't exist (default behavior)
      await appendFile('/path/to/log.txt', 'New log entry\n');

      // Append only if file exists, fail if it doesn't
      await appendFile('/path/to/log.txt', 'New log entry\n', { create: false });