passthrough-counter
Get the total buffer length of a stream.
This package has a good security score with no known vulnerabilities.
Community Reviews
Simple byte counter but lacks modern production features and maintenance
The implementation is straightforward and works reliably for basic use cases. No dependencies means minimal attack surface. However, it hasn't been updated since 2014, which shows in the lack of features I'd expect in production systems. There's no built-in error handling, no observability hooks, and no configuration options for things like high water marks or backpressure handling.
For simple scripts or low-stakes scenarios it's fine, but in high-throughput production environments I've had to wrap it with additional error handling and monitoring. The lack of TypeScript definitions is annoying. Consider modern alternatives or be prepared to add your own instrumentation layer around it.
Best for: Simple scripts or low-traffic applications where you need basic byte counting on streams with minimal overhead.
Avoid if: You need production-grade features like error handling, metrics integration, or active maintenance for modern Node.js versions.
Simple stream counter but extremely minimal with no modern tooling
The major issue is the complete lack of modern development support. There are no TypeScript definitions (not even in DefinitelyTyped), no inline JSDoc comments for IDE hints, and the README is just a few lines with a basic example. You're left guessing about edge cases like what happens with encoding or when streams error. The package hasn't been updated since 2014, predating async/await and modern Node.js stream APIs.
For quick scripts or legacy projects already using old-style streams, it works fine. But for any TypeScript project or team codebase where discoverability matters, you'll spend more time documenting it yourself than the package saves you. Consider using built-in stream utilities or more maintained alternatives.
Best for: Quick scripts or legacy Node.js projects needing simple byte counting in streams.
Avoid if: You're working in TypeScript or need modern async/await patterns with proper IDE support.
Simple stream counter but lacks modern DX features and maintenance
The main issue is the complete absence of TypeScript definitions, which means no autocomplete and no type safety in modern projects. You'll be writing your own declarations or working with `any` types. The documentation is sparse - just a brief README with one example. Error handling is non-existent; you're on your own if something goes wrong. The package hasn't been updated since 2014, which raises concerns about compatibility with modern Node.js versions, though it still functions.
For quick scripts or legacy projects already using older stream patterns, it gets the job done. But for production applications or TypeScript projects, you'll likely want something more robust or just implement the byte counting yourself - it's only a few lines of code.
Best for: Quick scripts or legacy Node.js projects needing simple byte counting in stream pipelines.
Avoid if: You're working in TypeScript, need robust error handling, or want actively maintained dependencies.
Sign in to write a review
Sign In