Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/k6/next/javascript-api/k6-websockets/blob.md, or by sending Accept: text/markdown to https://grafana.com/docs/k6/next/javascript-api/k6-websockets/blob/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
Blob
Blob is an interface that represents a blob, which is a file-like object of immutable, raw data; they can be read as text or binary data, or converted into a
ReadableStream.
It’s the type of the data received on
WebSocket.onmessage when WebSocket.binaryType is set to "blob".
A Blob instance has the following methods/properties:
| Class/Property | Description |
|---|---|
| Blob.size | The number of bytes of data contained within the Blob. |
| Blob.type | A string containing the MIME type, or an empty string if the type could not be determined. |
| Blob.arrayBuffer() | Returns a Promise that resolves with the contents of the blob as binary data contained in an ArrayBuffer. |
| Blob.bytes() | Returns a Promise that resolves with a Uint8Array containing the contents of the blob as an array of bytes. |
| Blob.slice() | Returns a new Blob object which contains data from a subset of the blob on which it’s called. |
| Blob.stream() | Returns a
ReadableStream which upon reading returns the data contained within the Blob. |
| Blob.text() | Returns a Promise that resolves with a string containing the contents of the blob, interpreted as UTF-8. |
Was this page helpful?
Related resources from Grafana Labs

