max-mapper / mississippi Goto Github PK
View Code? Open in Web Editor NEWA collection of useful stream utility modules for writing better code using streams
License: BSD 2-Clause "Simplified" License
A collection of useful stream utility modules for writing better code using streams
License: BSD 2-Clause "Simplified" License
Heads up: Although documented, parallel
is not being exported in the current 1.3.0 version.
Would you accept a PR that introduces a Promise-friendly API in addition to existing callback API?
E.g. if a callback argument is omitted, a Promise is returned:
miss.pipe(stream1, stream2, stream3).then(...).catch(...)
but the callback way would still work:
miss.pipe(stream1, stream2, stream3, cb)
I'm getting a little confused with the terminology of 'pump', 'pipe', and 'concat', but it looks to me like the collection here doesn't provide for gluing streams end-to-end.
Maybe https://www.npmjs.com/package/next-stream would do this?
It would be great to start a stream segment index, highlighting some of the more useful stream segments that are out there. Is there an awesome streams that already exists? Would that work well? Would an editorialised version work better?
https://github.com/mcollina/split2 seems in theme.
This looks like a really handly little toolkit for dealing with some of the oddities of node streams. I'd love to use it with Typescript, any interest in a type file?
hey there -
thanks for making and maintaining this module. i just ran into an issue after upgrading to node v6 - Uncaught TypeError: Cannot read property 'length' of undefined
- i believe this is fixed by:
mafintosh/duplexify@acf662f
any chance we can get an update to mississippi to include this fix? i can take a stab at it if that's helpful.
-matt
Worth adding https://github.com/PaulKinlan/fromwhatwgreadablestream ?
Hello,
Thank you for an awesome collection!
I think it would be helpful to denote in which (if any) versions a fix is present upstream in the documentation.
Stay well,
Jeff
Hey @maxogden !
I made a tiny module that is similar to pump called pump-chain, but instead of having a callback as the last parameter it bubbles the error from the intermediate streams to the last stream. This is useful when you module pipes multiple streams together and returns an outer stream for end-users to consume.
My real-world use cases for this module: spawning git child_process | parse output | return outer stream. (see 'git-' modules from https://github.com/alessioalex?tab=repositories click on 'sources').
Let me know if you think this is useful. Thanks
Hi!
I refer to the repo all the time; It's great. thanks! Hope this general streams question is OK.
I noticed that if you pipe/pump into concat-stream, and an error happens before any data passes,
concat's callback gets called before pipe's error handler.
So concat's callback gets an empty object, but I don't know if that means "there was no data" or "there was an error". I guess in this instance I'd like to be able to process.exit(1) from the error handler before processing the data, but I could see how in some cases you'd want it the other way around.
Am I using something wrong? Any tricks?
var fs = require('fs')
var miss = require('mississippi')
miss.pipe(
fs.createReadStream('./nofile'),
miss.concat(function (result) {
console.log('concat', result)
}),
function () {
console.log('error handler')
}
)
concat
error handler
from2
seems generalizable enough to add to this collection. What do ya'll think? I can PR the work involved if it fits.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.