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
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new File( sources, fileName, options?): File;
Defined in: node_modules/.pnpm/@types+node@24.6.2/node_modules/@types/node/buffer.d.ts:220
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
sources | ( | Blob | BinaryLike )[] |
fileName | string |
options? | FileOptions |
Returns
Section titled “Returns”File
Overrides
Section titled “Overrides”Properties
Section titled “Properties”lastModified
Section titled “lastModified”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
Inherited from
Section titled “Inherited from”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
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”arrayBuffer()
Section titled “arrayBuffer()”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.
Returns
Section titled “Returns”v15.7.0, v14.18.0
Inherited from
Section titled “Inherited from”bytes()
Section titled “bytes()”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 ]});
Returns
Section titled “Returns”Promise
<Uint8Array
<ArrayBufferLike
>>
Inherited from
Section titled “Inherited from”slice()
Section titled “slice()”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.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
start? | number | The starting index. |
end? | number | The ending index. |
type? | string | The content-type for the new Blob |
Returns
Section titled “Returns”v15.7.0, v14.18.0
Inherited from
Section titled “Inherited from”stream()
Section titled “stream()”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.
Returns
Section titled “Returns”v16.7.0
Inherited from
Section titled “Inherited from”text()
Section titled “text()”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.
Returns
Section titled “Returns”Promise
<string
>
v15.7.0, v14.18.0