-
-
Couldn't load subscription status.
- Fork 673
docs: add basic example of fetch #1035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
fix code formatting Co-authored-by: Matteo Collina <[email protected]>
fix code indentation Co-authored-by: Matteo Collina <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #1035 +/- ##
=======================================
Coverage 94.89% 94.89%
=======================================
Files 37 37
Lines 3623 3623
=======================================
Hits 3438 3438
Misses 185 185 Continue to review full report at Codecov.
|
README.md
Outdated
| } | ||
| ``` | ||
|
|
||
| If you require a Node stream, it is possible to convert between the two using `.fromWeb()`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make that a link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's actually .fromWeb() and .toWeb() if you are referring to converting between the two, since that implies both ways. Otherwise please formulate it in a way where it's explicit one way.
README.md
Outdated
|
|
||
| Basic usage example: | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, add js after triple ` when you open code blocks to enable syntax highlighting in examples. This will improve readability.
README.md
Outdated
|
|
||
| Nodejs has two kinds of streams: [web streams](https://nodejs.org/dist/latest-v16.x/docs/api/webstreams.html) which follow the API of the WHATWG web standard found in browsers, and an older Node-specific [streams API](https://nodejs.org/api/stream.html). `response.body` returns a readable web stream. If you would prefer to work with a Node stream you can convert a web stream using `.fromWeb()`. | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for this example - add js, please.
Add syntax highlighting to codeblock
* docs: add basic usage example of fetch * remove promise example * Update README.md fix code formatting Co-authored-by: Matteo Collina <[email protected]> * Update README.md fix code indentation Co-authored-by: Matteo Collina <[email protected]> * make fromWeb clearer * improve language about fromWeb * Update README.md Add syntax highlighting to codeblock Co-authored-by: Matteo Collina <[email protected]>
* docs: add basic usage example of fetch * remove promise example * Update README.md fix code formatting Co-authored-by: Matteo Collina <[email protected]> * Update README.md fix code indentation Co-authored-by: Matteo Collina <[email protected]> * make fromWeb clearer * improve language about fromWeb * Update README.md Add syntax highlighting to codeblock Co-authored-by: Matteo Collina <[email protected]>
Adding a simple usage example of Fetch and a very brief explanation of Node Streams vs Web Streams.
#940