Apache OpenDAL™ - v0.49.13
    Preparing search index...

    Class Writer

    Writer is designed to write data into a given path in an asynchronous manner.

    Index

    Constructors

    Methods

    • Abort an unfinished write and release resources held by the service.

      A successful abort ends the writer. Services that write directly to the destination may leave partial data.

      Returns Promise<void>

    • Close this writer.

      const writer = await op.writer("path/to/file");
      await writer.write(Buffer.from("hello world"));
      await writer.close();

      Returns Promise<void>

    • Create a writable stream that commits the write on successful completion. Destroying an unfinished stream waits for pending I/O and attempts to abort the writer. Cleanup depends on the service. If the stream already has an error, it reports that error.

      Parameters

      • Optionaloptions: WritableOptions<Writable>

      Returns Writable

    • Write bytes into this writer.

      Concurrent calls are serialized in the order they acquire the lock.

      const writer = await op.writer("path/to/file");
      await writer.write(Buffer.from("hello world"));
      await writer.close();

      Parameters

      • content: string | Buffer<ArrayBufferLike>

      Returns Promise<void>