Abortable stream.Writable Lab
Medium
100.0% Acceptance
In this lab, you will work with Node.js stream.Writable
module to create an abortable writable stream. The main objective is to create a custom writable stream that allows you to abort an ongoing write operation gracefully.
You will implement the following methods:
_write(chunk, encoding, callback)
: This is the main method responsible for writing the data.abort()
: This method will be used to abort the write operation.
Note: You need to export both AbortableWritableStream
class and the instance abortableStream
you create from it.
Prerequisites:
- Basic understanding of Node.js streams
- Familiarity with the concept of aborting in async processes