{"version":"1.0","type":"rich","title":"custom-writable-stream.js","description":"This example demonstrates a custom Writable stream in Node.js that stores incoming data in an in-memory object. It shows how to extend the `stream.Writable` class, using `util.inherits` to create the `WMStrm` constructor, which initializes a `Buffer` for a given key. The overridden `_write` method concatenates each chunk, whether already a `Buffer` or converted from a string, to the stored buffer. The code then writes two strings to the stream, triggers the `finish` event, and logs the accumulated result from the `memStore` object.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-ca199dd705eef449ae17?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}