Skip to content

File

Defined in: node_modules/.pnpm/@types+node@24.6.2/node_modules/@types/node/buffer.d.ts:219

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.6.2/node_modules/@types/node/buffer.d.ts:220

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

File

Blob.constructor

readonly lastModified: number;

Defined in: node_modules/.pnpm/@types+node@24.6.2/node_modules/@types/node/buffer.d.ts:230

The last modified date of the File.

v19.2.0, v18.13.0


readonly name: string;

Defined in: node_modules/.pnpm/@types+node@24.6.2/node_modules/@types/node/buffer.d.ts:225

The name of the File.

v19.2.0, v18.13.0


readonly size: number;

Defined in: node_modules/.pnpm/@types+node@24.6.2/node_modules/@types/node/buffer.d.ts:151

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.6.2/node_modules/@types/node/buffer.d.ts:156

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.6.2/node_modules/@types/node/buffer.d.ts:171

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.6.2/node_modules/@types/node/buffer.d.ts:182

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.6.2/node_modules/@types/node/buffer.d.ts:191

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.6.2/node_modules/@types/node/buffer.d.ts:202

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.6.2/node_modules/@types/node/buffer.d.ts:197

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