method

bun.FileBlob.slice

begin?: number,
end?: number,
contentType?: string

Offset any operation on the file starting at begin and ending at end. end is relative to 0

Similar to TypedArray.subarray. Does not copy the file, open the file, or modify the file.

If begin > 0, () is slower on macOS

@param begin

start offset in bytes

@param end

absolute offset in bytes (relative to 0)

@param contentType

MIME type for the new BunFile

begin?: number,
contentType?: string

Offset any operation on the file starting at begin

Similar to TypedArray.subarray. Does not copy the file, open the file, or modify the file.

If begin > 0, Bun.write() is slower on macOS

@param begin

start offset in bytes

@param contentType

MIME type for the new BunFile

contentType?: string

Slice the file from the beginning to the end, optionally with a new MIME type.

@param contentType

MIME type for the new BunFile