Skip to main content

aws-s3@1.0.0

get(params)
list(params)
put(params)

This adaptor exports the following from common:

as()
combine()
cursor()
dataPath()
dataValue()
dateFns
each()
field()
fields()
fn()
fnIf()
group()
lastReferenceValue()
map()
merge()
scrubEmojis()
sourceValue()
util

Functions

get

get(params) ⇒ Operation

Get an object from S3.

Attempts to parse JSON objects automatically into state.data. For binary objects the adaptor returns base64 in state.data.base64.

Returns: Operation - - A function that takes the state and performs the get operation.

ParamTypeDescription
paramsS3ParamsThe S3 operation parameters (bucket, key).

This operation writes the following keys to state:

State KeyDescription
stateOn success sets state.data to the parsed body (or { base64: '...' }) and state.response to the raw response metadata.

Example

get({ bucket: 'my-bucket', key: 'path/to/file.txt' });

list

list(params) ⇒ Operation

List objects in a bucket (by prefix).

Returns: Operation - - A function that takes the state and performs the list operation.

ParamTypeDescription
paramsS3ParamsThe S3 operation parameters (bucket, prefix, etc.)

This operation writes the following keys to state:

State KeyDescription
stateOn success sets state.data to the list of objects and state.response to the raw S3 response metadata.

Example

list({ bucket: 'my-bucket', prefix: 'path/to/' });

put

put(params) ⇒ Operation

Put an object into S3.

Returns: Operation - - A function that takes the state and performs the put operation.

ParamTypeDescription
paramsS3ParamsThe S3 operation parameters (bucket. key, body, contentType, etc.)

Example

put({ bucket: 'my-bucket', key: 'path/to/file.txt', body: 'hello' });

Interfaces

S3Params

S3 operation input params used by put, get, and list.

Properties

NameTypeDescription
keystringObject key for put/get (required for those ops)
[body]anyBody for put (string, Buffer, or stream)
[bucket]stringS3 bucket name (overrides configuration value)
[contentType]stringOptional content type for put
[prefix]stringPrefix for list operation
[maxKeys]numberMax keys for list
[continuationToken]stringContinuation token for list pagination