Provides information about files. Extends Blob.

Also available via require('node:buffer').File.

See also:

Constructor

new(sources:Array<BlobPart>, fileName:String, ?options:FilePropertyBag)

Variables

read onlylastModified:Float

The last modified date of the file (milliseconds since UNIX epoch).

read onlyname:String

The name of the file.

Inherited Variables

Defined by Blob

read onlysize:Int

The total size of the Blob in bytes.

read onlytype:String

The content-type of the Blob.

Inherited Methods

Defined by Blob

arrayBuffer():Promise<ArrayBuffer>

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

bytes():Promise<Uint8Array>

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

slice(?start:Int, ?end:Int, ?type:String):Blob

Creates and returns a new Blob containing a subset of this Blob's data.

stream():ReadableStream

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

text():Promise<String>

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