Function write

  • Use the fastest syscalls available to copy from input into destination.

    If destination exists, it must be a regular file or symlink to a file.

    Returns

    A promise that resolves with the number of bytes written.

    Parameters

    • destination: FileBlob | PathLike

      The file or file path to write to

    • input: string | Blob | TypedArray | ArrayBufferLike | BlobPart[]

      The data to copy into destination.

    Returns Promise<number>

  • Persist a Response body to disk.

    Returns

    A promise that resolves with the number of bytes written.

    Parameters

    • destination: FileBlob

      The file to write to. If the file doesn't exist, it will be created and if the file does exist, it will be overwritten. If input's size is less than destination's size, destination will be truncated.

    • input: Response

      Response object

    Returns Promise<number>

  • Persist a Response body to disk.

    Returns

    A promise that resolves with the number of bytes written.

    Parameters

    • destinationPath: PathLike

      The file path to write to. If the file doesn't exist, it will be created and if the file does exist, it will be overwritten. If input's size is less than destination's size, destination will be truncated.

    • input: Response

      Response object

    Returns Promise<number>

  • Use the fastest syscalls available to copy from input into destination.

    If destination exists, it must be a regular file or symlink to a file.

    On Linux, this uses copy_file_range.

    On macOS, when the destination doesn't already exist, this uses clonefile() and falls back to fcopyfile()

    Returns

    A promise that resolves with the number of bytes written.

    Parameters

    • destination: FileBlob

      The file to write to. If the file doesn't exist, it will be created and if the file does exist, it will be overwritten. If input's size is less than destination's size, destination will be truncated.

    • input: FileBlob

      The file to copy from.

    Returns Promise<number>

  • Use the fastest syscalls available to copy from input into destination.

    If destination exists, it must be a regular file or symlink to a file.

    On Linux, this uses copy_file_range.

    On macOS, when the destination doesn't already exist, this uses clonefile() and falls back to fcopyfile()

    Returns

    A promise that resolves with the number of bytes written.

    Parameters

    • destinationPath: PathLike

      The file path to write to. If the file doesn't exist, it will be created and if the file does exist, it will be overwritten. If input's size is less than destination's size, destination will be truncated.

    • input: FileBlob

      The file to copy from.

    Returns Promise<number>

  • Use the fastest syscalls available to copy from input into destination.

    If destination exists, it must be a regular file or symlink to a file.

    Returns

    A promise that resolves with the number of bytes written.

    Parameters

    • destination: FileBlob | PathLike

      The file or file path to write to

    • input: string | Blob | TypedArray | ArrayBufferLike | BlobPart[]

      The data to copy into destination.

    Returns Promise<number>

  • Persist a Response body to disk.

    Returns

    A promise that resolves with the number of bytes written.

    Parameters

    • destination: FileBlob

      The file to write to. If the file doesn't exist, it will be created and if the file does exist, it will be overwritten. If input's size is less than destination's size, destination will be truncated.

    • input: Response

      Response object

    Returns Promise<number>

  • Persist a Response body to disk.

    Returns

    A promise that resolves with the number of bytes written.

    Parameters

    • destinationPath: PathLike

      The file path to write to. If the file doesn't exist, it will be created and if the file does exist, it will be overwritten. If input's size is less than destination's size, destination will be truncated.

    • input: Response

      Response object

    Returns Promise<number>

  • Use the fastest syscalls available to copy from input into destination.

    If destination exists, it must be a regular file or symlink to a file.

    On Linux, this uses copy_file_range.

    On macOS, when the destination doesn't already exist, this uses clonefile() and falls back to fcopyfile()

    Returns

    A promise that resolves with the number of bytes written.

    Parameters

    • destination: FileBlob

      The file to write to. If the file doesn't exist, it will be created and if the file does exist, it will be overwritten. If input's size is less than destination's size, destination will be truncated.

    • input: FileBlob

      The file to copy from.

    Returns Promise<number>

  • Use the fastest syscalls available to copy from input into destination.

    If destination exists, it must be a regular file or symlink to a file.

    On Linux, this uses copy_file_range.

    On macOS, when the destination doesn't already exist, this uses clonefile() and falls back to fcopyfile()

    Returns

    A promise that resolves with the number of bytes written.

    Parameters

    • destinationPath: PathLike

      The file path to write to. If the file doesn't exist, it will be created and if the file does exist, it will be overwritten. If input's size is less than destination's size, destination will be truncated.

    • input: FileBlob

      The file to copy from.

    Returns Promise<number>

Generated using TypeDoc