Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-ebey committed Oct 25, 2023
1 parent 1db51bf commit c7cbb45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Turbo Stream
# Turbo Stream <br> [![turbo-stream's badge](https://deno.bundlejs.com/?q=turbo-stream&badge=detailed)](https://bundlejs.com/?q=turbo-stream)

A streaming data transport format that aims to support built-in features such as Promises, Dates, RegExps, Maps, Sets and more.

Expand All @@ -18,10 +18,10 @@ npm install turbo-stream
```js
import { decode, encode } from "turbo-stream";

const encodedStream = encode(Promise.resolve(42));
const encodedStream = encode({ answer: Promise.resolve(42) });
const decoded = await decode(encodedStream);
console.log(decoded.value); // a Promise
console.log(await decoded.value); // 42
console.log(decoded.value.answer); // a Promise
console.log(await decoded.value.answer); // 42
await decoded.done; // wait for the stream to finish
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "turbo-stream",
"version": "0.0.4",
"version": "0.0.5",
"description": "A streaming data transport format that aims to support built-in features such as Promises, Dates, RegExps, Maps, Sets and more.",
"type": "module",
"files": [
Expand Down

0 comments on commit c7cbb45

Please sign in to comment.