Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

s3-readstream

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

s3-readstream - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

21

dist/S3Readstream.d.ts

@@ -17,4 +17,25 @@ /// <reference types="node" />

constructor(options: S3ReadStreamOptions, nodeReadableStreamOptions?: ReadableOptions);
/**
* Adjust size of range to grab from S3
*
* @param {number} bytes - Number of bytes to set for range
*/
adjustByteRange(bytes: number): void;
/**
* Moves cursor bytes length back in file
*
* If current cursor position - number of bytes to move back
* is <= 0, set cursor at begining of file
* @param {number} bytes - Number of bytes to subtract from cursor (defaults to range)
*/
moveCursorBack(bytes?: number): void;
/**
* Moves cursor bytes length forward in file
*
* If current cursor position + number of bytes to move forward
* is > the length of the file, set cursor at end of file
* @param {number} bytes - Number of bytes to add to cursor (defaults to range)
*/
moveCursorForward(bytes?: number): void;
_read(): void;
}

39

dist/S3Readstream.js

@@ -28,8 +28,45 @@ "use strict";

_this._s3StreamParams = options.parameters;
_this._s3DataRange = options.byteRange || 1024 * 1024;
_this._s3DataRange = options.byteRange || 64 * 1024;
return _this;
}
/**
* Adjust size of range to grab from S3
*
* @param {number} bytes - Number of bytes to set for range
*/
S3ReadStream.prototype.adjustByteRange = function (bytes) {
this._s3DataRange = bytes;
};
/**
* Moves cursor bytes length back in file
*
* If current cursor position - number of bytes to move back
* is <= 0, set cursor at begining of file
* @param {number} bytes - Number of bytes to subtract from cursor (defaults to range)
*/
S3ReadStream.prototype.moveCursorBack = function (bytes) {
if (bytes === void 0) { bytes = this._s3DataRange; }
if (this._currentCursorPosition - bytes > 0) {
this._currentCursorPosition -= bytes;
}
else {
this._currentCursorPosition = 0;
}
};
/**
* Moves cursor bytes length forward in file
*
* If current cursor position + number of bytes to move forward
* is > the length of the file, set cursor at end of file
* @param {number} bytes - Number of bytes to add to cursor (defaults to range)
*/
S3ReadStream.prototype.moveCursorForward = function (bytes) {
if (bytes === void 0) { bytes = this._s3DataRange; }
if (this._currentCursorPosition + bytes <= this._maxContentLength) {
this._currentCursorPosition += bytes;
}
else {
this._currentCursorPosition += this._maxContentLength + 1;
}
};
S3ReadStream.prototype._read = function () {

@@ -36,0 +73,0 @@ var _this = this;

2

package.json
{
"name": "s3-readstream",
"version": "1.0.0",
"version": "1.0.1",
"description": "Drop in AWS S3 replacement read stream",

@@ -5,0 +5,0 @@ "main": "dist/S3Readstream.js",

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