Skip to content

v0.8.6: bunpy.node.stream -- in-memory stream shim

Choose a tag to compare

@tamnd tamnd released this 27 Apr 23:52
· 57 commits to main since this release
v0.8.6
37b9a71

v0.8.6 — bunpy.node.stream: in-memory stream shim

Adds bunpy.node.stream — Node.js stream module shim (in-memory, synchronous).

New

  • stream.Readable() — in-memory Readable with push/read/pipe
  • stream.Writable() — in-memory Writable with write/end/getContents
  • stream.PassThrough() — pass-through transform with write/read/pipe
  • stream.Transform() — alias for PassThrough

Notes

Streams are in-memory and synchronous — no async event loop required.
pipe() transfers buffered data to the destination Writable synchronously.

Usage

import bunpy.node.stream as stream
w = stream.Writable()
w.write("chunk1")
w.write("chunk2")
data = w.getContents()