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

@aws-sdk/lib-storage

Package Overview
Dependencies
Maintainers
7
Versions
437
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/lib-storage

Storage higher order operation

  • 3.36.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7M
decreased by-13.57%
Maintainers
7
Weekly downloads
 
Created

What is @aws-sdk/lib-storage?

The @aws-sdk/lib-storage package is part of the AWS SDK for JavaScript (v3) and provides high-level abstractions for uploading and downloading large objects to and from Amazon S3. It simplifies the process of handling multipart uploads and downloads, making it easier to work with large files or streams in a scalable and efficient manner.

What are @aws-sdk/lib-storage's main functionalities?

Multipart Upload

This feature allows for the uploading of large files to Amazon S3 in parts. The code sample demonstrates how to create a multipart upload using the Upload class. It also shows how to listen for upload progress events.

const { S3Client } = require('@aws-sdk/client-s3');
const { Upload } = require('@aws-sdk/lib-storage');
const client = new S3Client({});
const upload = new Upload({
  client,
  params: { Bucket: 'bucket-name', Key: 'file-key', Body: fileStream }
});
upload.on('httpUploadProgress', (progress) => {
  console.log(progress);
});
await upload.done();

Parallel Uploads

This feature enhances the multipart upload by allowing multiple parts of the file to be uploaded in parallel, which can significantly speed up the upload process for large files. The code sample demonstrates how to specify the number of parts to upload in parallel.

const { S3Client } = require('@aws-sdk/client-s3');
const { Upload } = require('@aws-sdk/lib-storage');
const client = new S3Client({});
const upload = new Upload({
  client,
  params: { Bucket: 'bucket-name', Key: 'file-key', Body: fileStream },
  queueSize: 4 // Number of parts to upload in parallel
});
await upload.done();

Multipart Download

While the primary focus of @aws-sdk/lib-storage is on uploading, it provides the foundation for handling large objects that could be extended for multipart downloads, though as of the last update, explicit multipart download functionality is not directly exposed.

N/A

Other packages similar to @aws-sdk/lib-storage

FAQs

Package last updated on 12 Oct 2021

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

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