From 44f04944112ad755ed90488550fcf0e4b43270ec Mon Sep 17 00:00:00 2001 From: Frank Hinek Date: Mon, 4 Dec 2023 12:55:33 -0500 Subject: [PATCH] Update README with new `record.data` methods Signed-off-by: Frank Hinek --- README.md | 8 +++++--- packages/api/README.md | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e21bc1844..1e48073a1 100644 --- a/README.md +++ b/README.md @@ -170,9 +170,11 @@ Each `Record` instance has the following instance properties: `id`, `attestation Each `Record` instance has the following instance methods: - **`data`** - _`object`_: an object with the following convenience methods that read out the data of the record entry in the following formats: - - **`text`** - _`function`_: produces a textual representation of the data. - - **`json`** - _`function`_: if the value is JSON data, this method will return a parsed JSON object. - - **`stream`** - _`function`_: returns the raw stream of bytes for the data. + - **`blob`** - _`function`_: returns the data as a [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob). + - **`bytes`** - _`function`_: returns the data as a raw byte array in `Uint8Array` format. + - **`json`** - _`function`_: returns a parsed JSON object. + - **`stream`** - _`function`_: returns the data as a raw stream of bytes. + - **`text`** - _`function`_: returns the data as a string. - **`send`** - _`function`_: sends the record the instance represents to the DWeb Node endpoints of a provided DID. - **`update`** - _`function`_: takes in a new request object matching the expected method signature of a `write` and overwrites the record. This is a convenience method that allows you to easily overwrite records with less verbosity. diff --git a/packages/api/README.md b/packages/api/README.md index 1539a5ae0..72a7ff5d0 100644 --- a/packages/api/README.md +++ b/packages/api/README.md @@ -163,9 +163,11 @@ Each `Record` instance has the following instance properties: `id`, `attestation Each `Record` instance has the following instance methods: - **`data`** - _`object`_: an object with the following convenience methods that read out the data of the record entry in the following formats: - - **`text`** - _`function`_: produces a textual representation of the data. - - **`json`** - _`function`_: if the value is JSON data, this method will return a parsed JSON object. - - **`stream`** - _`function`_: returns the raw stream of bytes for the data. + - **`blob`** - _`function`_: returns the data as a [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob). + - **`bytes`** - _`function`_: returns the data as a raw byte array in `Uint8Array` format. + - **`json`** - _`function`_: returns a parsed JSON object. + - **`stream`** - _`function`_: returns the data as a raw stream of bytes. + - **`text`** - _`function`_: returns the data as a string. - **`send`** - _`function`_: sends the record the instance represents to the DWeb Node endpoints of a provided DID. - **`update`** - _`function`_: takes in a new request object matching the expected method signature of a `write` and overwrites the record. This is a convenience method that allows you to easily overwrite records with less verbosity.