Comments (6)
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.
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.
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.
from bob.
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.
Ok next bit is to write reasonable automated tests, haha π¬ .
from bob.
Related Issues (20)
- Official way of doing C++ binding detection
- Non-single-logical-flow (multiple pulls) HOT 9
- convert to npm module with 'top-level' require-able helpers HOT 3
- Make Stream() an async iterator HOT 1
- automated tests
- Progress 23/07/2019 - July
- Blog about this? HOT 2
- Stream livecoding for this?
- Organize a meeting HOT 1
- move StdoutSink into a `stdio-sink` module?
- Buffer allocation hints
- Construct flow HOT 1
- Managed state
- Where do object streams fit in? HOT 8
- potential stack overflows HOT 11
- clean up the source after stopping HOT 1
- Potential streams3 adaptor bugs
- Compare more to alternate ideas, such as push-stream.
- Progress 11/12/2019 - December
- Slides from MontrΓ©al collab summit 2019
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bob.