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

Constructors

Methods

  • Safety

    &mut self in async napi methods should be marked as unsafe

    Close this writer.

    Example

    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 from the underlying writer.

    Parameters

    • Optional options: WritableOptions

    Returns Writable

  • Safety

    &mut self in async napi methods should be marked as unsafe

    Write bytes into this writer.

    Example

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

    Parameters

    • content: string | Buffer

    Returns Promise<void>

Copyright © 2022-2024, The Apache Software Foundation. Apache OpenDAL, OpenDAL, and Apache are either registered trademarks or trademarks of the Apache Software Foundation.