Socket
Socket
Sign inDemoInstall

@aws-sdk/client-s3

Package Overview
Dependencies
Maintainers
5
Versions
432
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-s3

AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native


Version published
Weekly downloads
6.6M
increased by5.93%
Maintainers
5
Weekly downloads
 
Created

What is @aws-sdk/client-s3?

The @aws-sdk/client-s3 npm package is a client library for Amazon Simple Storage Service (S3) that allows developers to interact with S3 services using JavaScript or TypeScript. It provides methods to perform operations such as creating and managing buckets, uploading and downloading objects, and managing access permissions.

What are @aws-sdk/client-s3's main functionalities?

Creating a Bucket

This feature allows you to create a new S3 bucket in a specified AWS region.

const { S3Client, CreateBucketCommand } = require('@aws-sdk/client-s3');
const client = new S3Client({ region: 'us-west-2' });
const command = new CreateBucketCommand({ Bucket: 'my-bucket-name' });
client.send(command);

Uploading an Object

This feature allows you to upload an object to a specified bucket in S3.

const { S3Client, PutObjectCommand } = require('@aws-sdk/client-s3');
const client = new S3Client({ region: 'us-west-2' });
const command = new PutObjectCommand({ Bucket: 'my-bucket-name', Key: 'my-object-key', Body: 'Hello, world!' });
client.send(command);

Downloading an Object

This feature allows you to download an object from S3 by specifying the bucket and object key.

const { S3Client, GetObjectCommand } = require('@aws-sdk/client-s3');
const client = new S3Client({ region: 'us-west-2' });
const command = new GetObjectCommand({ Bucket: 'my-bucket-name', Key: 'my-object-key' });
client.send(command).then((data) => console.log(data.Body));

Listing Objects in a Bucket

This feature allows you to list all objects in a specified S3 bucket.

const { S3Client, ListObjectsCommand } = require('@aws-sdk/client-s3');
const client = new S3Client({ region: 'us-west-2' });
const command = new ListObjectsCommand({ Bucket: 'my-bucket-name' });
client.send(command).then((data) => console.log(data.Contents));

Deleting an Object

This feature allows you to delete an object from a specified S3 bucket.

const { S3Client, DeleteObjectCommand } = require('@aws-sdk/client-s3');
const client = new S3Client({ region: 'us-west-2' });
const command = new DeleteObjectCommand({ Bucket: 'my-bucket-name', Key: 'my-object-key' });
client.send(command);

Other packages similar to @aws-sdk/client-s3

FAQs

Package last updated on 07 Aug 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

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