New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

stream-length

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-length - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

17

lib/stream-length.js

@@ -1,2 +0,2 @@

var Promise, createRetrieverPromise, fs, nodeifyWrapper, retrieveBuffer, retrieveCoreHttpStream, retrieveFilesystemStream, retrieveRequestHttpStream;
var Promise, createRetrieverPromise, fs, nodeifyWrapper, retrieveBuffer, retrieveCombinedStream, retrieveCoreHttpStream, retrieveFilesystemStream, retrieveRequestHttpStream;

@@ -16,3 +16,2 @@ Promise = require("bluebird");

if (result instanceof Error) {
console.log("REJECTING...", result);
return reject(result);

@@ -79,2 +78,14 @@ } else {

retrieveCombinedStream = function(stream, callback) {
if (stream.getCombinedStreamLength != null) {
return stream.getCombinedStreamLength().then(function(length) {
return callback(length);
})["catch"](function(err) {
return callback(err);
});
} else {
return callback(null);
}
};
module.exports = function(stream, options, callback) {

@@ -94,3 +105,3 @@ if (options == null) {

}
_ref1 = [retrieveBuffer, retrieveFilesystemStream, retrieveCoreHttpStream, retrieveRequestHttpStream];
_ref1 = [retrieveBuffer, retrieveFilesystemStream, retrieveCoreHttpStream, retrieveRequestHttpStream, retrieveCombinedStream];
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {

@@ -97,0 +108,0 @@ retriever = _ref1[_j];

2

package.json
{
"name": "stream-length",
"version": "1.0.1",
"version": "1.0.2",
"description": "For a given Buffer or Stream, this module will attempt to determine the total length of the stream contents. It currently supports Buffers, `fs` streams, `http` responses, and `request` objects, and allows for specifying custom stream types.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -9,3 +9,3 @@ # stream-length

[WTFPL](http://www.wtfpl.net/txt/copying/) or [CC0](https://creativecommons.org/publicdomain/zero/1.0/), whichever you prefer.
[WTFPL](http://www.wtfpl.net/txt/copying/) or [CC0](https://creativecommons.org/publicdomain/zero/1.0/), whichever you prefer. A donation and/or attribution are appreciated, but not required.

@@ -26,2 +26,10 @@ ## Donate

## Supported stream types
* Buffers
* `fs.createReadStream` streams
* `http.request` and `http.get` responses
* `request` requests
* `combined-stream2` streams
## Usage

@@ -28,0 +36,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc