New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

s3-range-zip

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

s3-range-zip

Load individual files from zip files on S3 using range

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

s3-range-zip

Load individual files from zip files on S3 without downloading the entire zip using range parameters.

Installation

npm install s3-range-zip

Usage

const reader = new S3RangeZip();

const fileList = await reader.fetchFileList('bucket', 'key');
console.log(fileList);

const file = await reader.downloadFile('bucket', 'key', 'myfile.txt', {encoding: 'utf8'})
console.log(file);

class S3RangeZip

constructor(s3Client)

  • s3UrlFun <function> Optionally, pass a function to use a custom URL scheme.

    Default:

    (bucketName, key) => `https://${bucketName}.s3.amazonaws.com/${key}`
    

async fetchFileList(bucketName, key)

  • bucketName <string> S3 Bucket name
  • key <string> S3 Item key

Returns the list of files in the zip.

async downloadFile(bucketName, key, fileName, options)

  • bucketName <string> S3 Bucket name
  • key <string> S3 Item key
  • fileName <string> Name of file inside the zip to download and decompress
  • options <object> Optional
Option NameTypeDescription
encodingstringutf8 to return string instead of default Uint8Array
onProgress(receivedBytes, totalBytes)functionreceive updates during download

Returns the decompressed file contents as Uint8Array or string.

License

MIT

FAQs

Package last updated on 12 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts