simple-concat
Super-minimalist version of `concat-stream`. Less than 15 lines!
This package has a good security score with no known vulnerabilities.
Community Reviews
Does one thing well, but minimal docs mean you need to know streams first
The learning curve is minimal if you already understand Node streams, but the README is extremely bare-bones. There are only two basic examples showing Buffer and string usage. Error handling isn't explicitly documented - you need to realize that stream errors won't be caught unless you attach an error listener yourself. This caught me off guard initially.
Debugging is straightforward since there's almost no code to debug. When things go wrong, it's usually your stream that's the problem, not simple-concat. The package has no dependencies, which means zero supply chain concerns and nothing breaks when you upgrade Node versions.
Best for: Developers comfortable with Node streams who need a lightweight way to collect stream data without extra dependencies.
Avoid if: You're new to streams and need comprehensive documentation, or you need advanced features like size limits or object mode support.
Minimalist buffer concatenation with critical memory concerns
The biggest operational concern is the complete lack of memory safeguards. There's no max buffer size, no backpressure handling, and no timeout mechanism. In production, this means a slow or malicious client can easily cause memory exhaustion by sending data indefinitely. You get zero observability into how much memory is being consumed until your process crashes.
For small, trusted inputs where you control the source, it's fine. But for any user-facing service or scenarios with untrusted data, you need to wrap this with your own timeouts and size checks, which defeats the purpose of using a minimal library. The error handling is basic - errors propagate to the callback, but there's no retry logic or resource cleanup hooks.
Best for: Internal tools or scripts where input size is known and trusted, like reading small config files.
Avoid if: You're handling user uploads, external API responses, or any untrusted/unbounded input streams.
Lightweight buffer concatenation with minimal overhead but no safety rails
The critical caveat is memory management: there's zero protection against unbounded streams. You must enforce size limits upstream or risk OOM crashes. No timeout handling, no max size parameter, no backpressure—it just accumulates everything. For trusted, bounded streams (parsing small config files, handling API responses with size limits elsewhere), it works perfectly with negligible overhead.
Error handling is basic but functional—errors are passed to your callback. No retry logic or configurability, which is fine given its scope. The lack of TypeScript definitions in older projects can be annoying, though @types/simple-concat exists. For production APIs handling user uploads or external streams, you'll want concat-stream or custom logic with size guards.
Best for: Small, bounded streams where you need minimal overhead and already have size/timeout controls upstream.
Avoid if: You're handling untrusted input, large files, or need built-in size limits and timeout management.
Sign in to write a review
Sign In