GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — doc: how to decode buffers extending from Writable by dicearr · Pull Request #16403 · nodejs/node Conversation
|
|
Hi @dicearr! Thank you for a try to improve the docs. We lint code fragments in docs (you can run Currently, there are some issues with the linter:
You can fix them in a new commit or amend the existing one. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
cc @nodejs/documentation |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM with some nits.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| Decoding buffers is a common task, for instance, when using transformers whose | ||
| input is a string. This is not a trivial process when using multi-byte | ||
| characters encoding. Implement it within [Writable][] implies some performance |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I would add: "...multi-byte characters encoding, such as UTF-8."
I would remove the sentence "Implement it within Writable implies some performance regressions".
Then:
"The following example shows how to decode multi-byte strings using StringDecoder and Writable."
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| this._data += this._decoder.end(); | ||
| callback(); | ||
| } | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
it would be good to add a quick example on how to use this.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| w.write(euro[0]); | ||
| w.end(euro[1]); | ||
|
|
||
| console.log(w._data); // currency: € |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
can you please rename _data into data? accessing a prefixed property from outside is encouraging to tinker with the stream private properties, which is something we would like to avoid.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
CI failures are unrelated, landing. Thanks for your first contribution @dicearr 🎉 ! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed as e509db8! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Improved stream documentation with an example of how to decode buffers to strings within a custom Writable. Fixes: #15369 PR-URL: #16403 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Improved stream documentation with an example of how to decode buffers to strings within a custom Writable. Fixes: nodejs/node#15369 PR-URL: nodejs/node#16403 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Improved stream documentation with an example of how to decode buffers to strings within a custom Writable. Fixes: nodejs/node#15369 PR-URL: nodejs/node#16403 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Improved stream documentation with an example of how to decode buffers to strings within a custom Writable. Fixes: nodejs#15369 PR-URL: nodejs#16403 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Improved stream documentation with an example of how to decode buffers to strings within a custom Writable. Fixes: #15369 PR-URL: #16403 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Improved stream documentation with an example of how to decode buffers to strings within a custom Writable. Fixes: #15369 PR-URL: #16403 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
Improved stream documentation with an example of how to decode buffers to strings within a custom Writable. Fixes: nodejs/node#15369 PR-URL: nodejs/node#16403 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Document how to use StringDecoder in combination with stream.Transform
There was an error while loading. Please reload this page.