KVStoreEntry
Class for interacting with a Fastly KV store entry.
Properties
A ReadableStream with the contents of the entry.
A boolean value that indicates whether the body has been read from already.
Methods
arrayBuffer
View sourceReads the body and returns it as a promise that resolves with an ArrayBuffer.
Returns
json
View sourceReads 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 sourceBinary metadata associated with this entry, up to 1000 bytes.
Returns null if no metadata is set.
Returns
ArrayBuffer | null
metadataText
View sourcemetadataText(): string | nullMetadata 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
View sourceReads the body and returns it as a promise that resolves with a string. The response is always decoded using UTF-8.
Returns
Promise<string>