Socket
Socket
Sign inDemoInstall

@aws-sdk/client-s3

Package Overview
Dependencies
42
Maintainers
4
Versions
400
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @aws-sdk/client-s3

@aws-sdk/client-s3 client


Version published
Weekly downloads
4.5M
decreased by-19.41%
Maintainers
4
Created
Weekly downloads
 

Package description

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

Readme

Source

@aws-sdk/client-s3

NPM version NPM downloads

For SDK usage, please step to SDK reademe.

FAQs

Last updated on 09 Feb 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc