KVStoreEntry

Interfacein kv-store@fastly/js-compute 4.0.0View source

Class for interacting with a Fastly KV store entry.

Properties

A ReadableStream with the contents of the entry.

bodyUsed

booleanread-onlyView source

A boolean value that indicates whether the body has been read from already.

Methods

arrayBuffer

View source
arrayBuffer(): Promise<ArrayBuffer>

Reads the body and returns it as a promise that resolves with an ArrayBuffer.

Returns

json(): Promise<object>

Reads the body and returns it as a promise that resolves with the result of parsing the body text as JSON.

Returns

Promise<object>

metadata

View source
metadata(): ArrayBuffer | null

Binary metadata associated with this entry, up to 1000 bytes.

Returns null if no metadata is set.

Returns

metadataText

View source
metadataText(): string | null

Metadata associated with this entry, decoded as a UTF-8 string.

Returns null if no metadata is set.

Returns

string | null

Throws

  • If the metadata is not valid UTF-8.
text(): Promise<string>

Reads the body and returns it as a promise that resolves with a string. The response is always decoded using UTF-8.

Returns

Promise<string>