Skip to content

Commit fcbadf4

Browse files
committed
feat: Update STATUS-NODE.md to reflect stream module implementation and status
1 parent 2cfc210 commit fcbadf4

1 file changed

Lines changed: 40 additions & 11 deletions

File tree

STATUS-NODE.md

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This document tracks Node.js module and API implementation status in SharpTS.
44

5-
**Last Updated:** 2026-01-28 (Added timers, string_decoder, perf_hooks modules; crypto.randomFillSync)
5+
**Last Updated:** 2026-01-29 (Added stream module with Readable, Writable, Duplex, Transform, PassThrough)
66

77
## Legend
88
- ✅ Implemented
@@ -28,7 +28,7 @@ This document tracks Node.js module and API implementation status in SharpTS.
2828
| `console` || log, error, warn, info, debug, clear, time/timeEnd/timeLog, assert, count/countReset, table, dir, group/groupEnd, trace |
2929
| `readline` | ⚠️ | Basic synchronous I/O |
3030
| `events` || EventEmitter with on/off/once/emit/removeListener |
31-
| `stream` | | No Readable/Writable/Transform |
31+
| `stream` | | Readable, Writable, Duplex, Transform, PassThrough (sync mode) |
3232
| `buffer` || Full Buffer class with multi-byte LE/BE, float/double, BigInt, search, swap |
3333
| `timers` || setTimeout, setInterval, setImmediate + clear variants (module import) |
3434
| `string_decoder` || StringDecoder class for multi-byte character handling |
@@ -351,14 +351,43 @@ This document tracks Node.js module and API implementation status in SharpTS.
351351

352352
| Feature | Status | Notes |
353353
|---------|--------|-------|
354-
| `Readable` class || |
355-
| `Writable` class || |
356-
| `Transform` class || |
357-
| `Duplex` class || |
358-
| `pipe()` method || |
354+
| **Readable** | | |
355+
| `new Readable()` || Constructor with options |
356+
| `push(chunk)` || Add data to buffer; null signals EOF |
357+
| `read()` || Read from buffer |
358+
| `pipe(dest)` || Pipe to Writable/Duplex, returns destination |
359+
| `unpipe(dest)` || Remove pipe destination |
360+
| `readable` || Property: stream is readable |
361+
| `readableEnded` || Property: EOF reached |
362+
| `readableLength` || Property: buffer size |
363+
| `'end'` event || Emitted when EOF reached |
364+
| **Writable** | | |
365+
| `new Writable()` || Constructor with write callback option |
366+
| `write(chunk)` || Write data, invokes write callback |
367+
| `end()` || Signal end of writes |
368+
| `cork()` / `uncork()` || Buffer writes |
369+
| `writable` || Property: stream is writable |
370+
| `writableEnded` || Property: end() called |
371+
| `writableFinished` || Property: all data flushed |
372+
| `'finish'` event || Emitted when all writes complete |
373+
| **Duplex** | | |
374+
| `new Duplex()` || Readable + Writable combined |
375+
| All Readable methods || Inherited |
376+
| All Writable methods || Added |
377+
| **Transform** | | |
378+
| `new Transform()` || Constructor with transform callback |
379+
| `transform(chunk, enc, cb)` || Transform callback; cb(null, data) pushes |
380+
| All Duplex methods || Inherited |
381+
| **PassThrough** | | |
382+
| `new PassThrough()` || Transform that passes data unchanged |
383+
| **Process Streams** | | |
359384
| `process.stdout.write()` || Basic only |
360385
| `process.stderr.write()` || Basic only |
361386
| `process.stdin` events || No event-based input |
387+
| **Not Implemented** | | |
388+
| Flowing mode || Sync push/pull only |
389+
| Object mode || Buffer/string chunks only |
390+
| Backpressure || No highWaterMark handling |
362391

363392
---
364393

@@ -530,12 +559,12 @@ This document tracks Node.js module and API implementation status in SharpTS.
530559

531560
## Summary
532561

533-
SharpTS provides comprehensive support for file system operations (sync), including file descriptor APIs, directory utilities, hard/symbolic links, and permissions. Also includes path manipulation, OS information, process management, crypto (hashing, encryption, key derivation, signing), URL parsing, binary data handling via Buffer, EventEmitter for event-driven patterns, timers (setTimeout/setInterval/setImmediate), string decoding for multi-byte characters, and high-resolution performance timing. The module system supports both ES modules and CommonJS import syntax.
562+
SharpTS provides comprehensive support for file system operations (sync), including file descriptor APIs, directory utilities, hard/symbolic links, and permissions. Also includes path manipulation, OS information, process management, crypto (hashing, encryption, key derivation, signing), URL parsing, binary data handling via Buffer, EventEmitter for event-driven patterns, timers (setTimeout/setInterval/setImmediate), string decoding for multi-byte characters, high-resolution performance timing, and stream classes (Readable, Writable, Duplex, Transform, PassThrough) with sync push/pull mode and pipe support. The module system supports both ES modules and CommonJS import syntax.
534563

535564
**Key Gaps:**
536-
- No Stream classes (limits file/network streaming)
537565
- No async fs operations (sync-only workaround)
538566
- No network modules (http, net, dns)
567+
- No flowing/async stream mode (sync push/pull only)
539568

540569
**Recommended Workarounds:**
541570
- Use `*Sync` versions of fs methods
@@ -548,5 +577,5 @@ SharpTS provides comprehensive support for file system operations (sync), includ
548577
Priority features to implement for broader Node.js compatibility:
549578

550579
1. **Async fs APIs** - `fs.promises` or callback-based (higher effort)
551-
2. **Streams API** - Needed for large file handling (higher effort)
552-
3. **http module** - Basic HTTP server/client (higher effort)
580+
2. **http module** - Basic HTTP server/client (higher effort)
581+
3. **Flowing stream mode** - Event-based async streaming (higher effort)

0 commit comments

Comments
 (0)