Skip to content

File

Defined in: node_modules/.pnpm/@types+node@24.9.1/node_modules/@types/node/buffer.d.ts:223

A File provides information about files.

v19.2.0, v18.13.0

new File(
sources,
fileName,
options?): File;

Defined in: node_modules/.pnpm/@types+node@24.9.1/node_modules/@types/node/buffer.d.ts:224

ParameterType
sources( | Blob | BinaryLike)[]
fileNamestring
options?FileOptions

File

Blob.constructor

readonly lastModified: number;

Defined in: node_modules/.pnpm/@types+node@24.9.1/node_modules/@types/node/buffer.d.ts:234

The last modified date of the File.

v19.2.0, v18.13.0


readonly name: string;

Defined in: node_modules/.pnpm/@types+node@24.9.1/node_modules/@types/node/buffer.d.ts:229

The name of the File.

v19.2.0, v18.13.0


readonly size: number;

Defined in: node_modules/.pnpm/@types+node@24.9.1/node_modules/@types/node/buffer.d.ts:155

The total size of the Blob in bytes.

v15.7.0, v14.18.0

Blob.size


readonly type: string;

Defined in: node_modules/.pnpm/@types+node@24.9.1/node_modules/@types/node/buffer.d.ts:160

The content-type of the Blob.

v15.7.0, v14.18.0

Blob.type

arrayBuffer(): Promise<ArrayBuffer>;

Defined in: node_modules/.pnpm/@types+node@24.9.1/node_modules/@types/node/buffer.d.ts:175

Returns a promise that fulfills with an ArrayBuffer containing a copy of the Blob data.

Promise<ArrayBuffer>

v15.7.0, v14.18.0

Blob.arrayBuffer


bytes(): Promise<Uint8Array<ArrayBufferLike>>;

Defined in: node_modules/.pnpm/@types+node@24.9.1/node_modules/@types/node/buffer.d.ts:186

The blob.bytes() method returns the byte of the Blob object as a Promise<Uint8Array>.

const blob = new Blob(['hello']);
blob.bytes().then((bytes) => {
console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ]
});

Promise<Uint8Array<ArrayBufferLike>>

Blob.bytes


slice(
start?,
end?,
type?): Blob;

Defined in: node_modules/.pnpm/@types+node@24.9.1/node_modules/@types/node/buffer.d.ts:195

Creates and returns a new Blob containing a subset of this Blob objects data. The original Blob is not altered.

ParameterTypeDescription
start?numberThe starting index.
end?numberThe ending index.
type?stringThe content-type for the new Blob

Blob

v15.7.0, v14.18.0

Blob.slice


stream(): ReadableStream;

Defined in: node_modules/.pnpm/@types+node@24.9.1/node_modules/@types/node/buffer.d.ts:206

Returns a new ReadableStream that allows the content of the Blob to be read.

ReadableStream

v16.7.0

Blob.stream


text(): Promise<string>;

Defined in: node_modules/.pnpm/@types+node@24.9.1/node_modules/@types/node/buffer.d.ts:201

Returns a promise that fulfills with the contents of the Blob decoded as a UTF-8 string.

Promise<string>

v15.7.0, v14.18.0

Blob.text