Socket
Book a DemoInstallSign in
Socket

barnard59-s3

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

barnard59-s3

S3 support for Linked Data pipelines

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

barnard59-s3

Add support for S3 to barnard59.

Working with files

getObject

Get an object from a S3 bucket into the file system.

OptionTypeRequiredDescription
bucketstringtrueThe name of the S3 bucket
keystringtrueThe key of the object
destinationPathstringtrueThe path where the object should be downloaded. If the directory that contains the path do not exist, it will be created.
accessKeyIdstringfalseS3 Access Key ID
secretAccessKeystringfalseS3 Secret Access Key

And all options from S3ClientConfigType of the AWS SDK, which includes those fields for example:

  • endpoint (type: string ; configure a custom endpoint)
  • region (type: string ; defaults to us-east-1 if not specified)
  • forcePathStyle (type: boolean; set to true if you want to use a custom endpoint)

putObject

Put an object from the file system into a S3 bucket.

OptionTypeRequiredDescription
bucketstringtrueThe name of the S3 bucket
keystringtrueThe key of the object
sourcePathstringtrueThe path of the file on the local file system
accessKeyIdstringfalseS3 Access Key ID
secretAccessKeystringfalseS3 Secret Access Key

And all options from S3ClientConfigType of the AWS SDK, which includes those fields for example:

  • endpoint (type: string ; configure a custom endpoint)
  • region (type: string ; defaults to us-east-1 if not specified)
  • forcePathStyle (type: boolean; set to true if you want to use a custom endpoint)

Working with streams

getObjectStream (getObject/stream operation)

Get an object from a S3 bucket as a Readable stream.

OptionTypeRequiredDescription
bucketstringtrueThe name of the S3 bucket
keystringtrueThe key of the object
accessKeyIdstringfalseS3 Access Key ID
secretAccessKeystringfalseS3 Secret Access Key

And all options from S3ClientConfigType of the AWS SDK, which includes those fields for example:

  • endpoint (type: string ; configure a custom endpoint)
  • region (type: string ; defaults to us-east-1 if not specified)
  • forcePathStyle (type: boolean; set to true if you want to use a custom endpoint)

This returns a Readable stream that contains the content of the requested object.

Upload data to S3

To put a stream into a S3 bucket, you will need to first write the stream to a file and then use putObject to upload the file to S3.

Direct stream to S3 upload is not supported.

Keywords

barnard59

FAQs

Package last updated on 29 Dec 2023

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