Skip to content

Commit

Permalink
Update README with new record.data methods
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Hinek <[email protected]>
  • Loading branch information
frankhinek committed Dec 4, 2023
1 parent 3021111 commit 44f0494
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
8 changes: 5 additions & 3 deletions packages/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 44f0494

Please sign in to comment.