happy-opfs
    Preparing search index...

    Function writeFileSync

    • Synchronous version of writeFile. Writes content to a file at the specified path.

      Parameters

      • filePath: string

        The absolute path of the file to write.

      • contents: WriteSyncFileContent

        The content to write (ArrayBuffer, TypedArray, or string).

      • Optionaloptions: WriteOptions

        Optional write options.

      Returns VoidIOResult

      A VoidIOResult indicating success or failure.

      writeFile for the async version.

      1.1.0

      // Write string content
      writeFileSync('/path/to/file.txt', 'Hello, World!');

      // Write binary content
      writeFileSync('/path/to/file.bin', new Uint8Array([1, 2, 3]));