Git Product home page Git Product logo

Comments (6)

Fishrock123 avatar Fishrock123 commented on August 17, 2024 1

Ok so I dunno why I didn't think about this before but pull-stream has modules that do this that I should be able to adapt. I am not sure they do it 100% correctly, but if it works it works.

e.g. https://github.com/pull-stream/pull-stream-to-stream, https://www.npmjs.com/package/pull-to-stream

Edit: thanks to @Raynos for this very obvious suggestion. πŸ€¦β€β™‚

from bob.

Fishrock123 avatar Fishrock123 commented on August 17, 2024 1

OK I think it works. Like. Actually. WORKS.

https://github.com/Fishrock123/bob/blob/streams3-adaptor/helpers/bob-duplex.js

Test cases:
(manually verify the output file, readme_ or readme.gz (there is an ungzip helper in tests/).
(may require Node 13)

node tests/bob-streams3-from-source.js readme.md

node tests/bob-streams3-to-sink.js readme.md

node tests/bob-streams3-files.js readme.md

node tests/bob-streams3-zlib.js readme.md

Use NODE_DEBUG=bob to see what is happening.

Replace readme.md with your choice of file.

from bob.

Fishrock123 avatar Fishrock123 commented on August 17, 2024

Some semi-working progress here: https://github.com/Fishrock123/bob/tree/streams3-adaptor

Seems to work(?): fs-source -> duplex --pipe-> duplex -> fs-sink

Doesn't work: fs-source -> duplex --pipe-> zlib-gzip-transform --pipe-> duplex -> fs-sink

cc @mcollina

from bob.

mcollina avatar mcollina commented on August 17, 2024

from bob.

Fishrock123 avatar Fishrock123 commented on August 17, 2024

source -> (sink -> duplex) -> zlib -> (duplex -> source) -> sink

Wouldn't constructing that be really awkward?

Ideally I'd like:

Stream(sourceOrStream).pipe(streams3_transform).pipe(Stream(sinkOrStream))

from bob.

Fishrock123 avatar Fishrock123 commented on August 17, 2024

Ok next bit is to write reasonable automated tests, haha 😬 .

from bob.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.