s3st
Version:
A command line utility that allows you to stream data from multiple S3 objects directly into your terminal
26 lines (20 loc) • 654 B
JavaScript
const S3ListBucketStream = require('s3-list-bucket-stream')
const S3ObjectContentStream = require('s3-object-content-stream')
const pumpify = require('pumpify')
const createS3stStream = (s3, bucketName, prefix = '', transformer = undefined) => {
// create the instance for the list bucket stream
const listBucketStream = new S3ListBucketStream(
s3,
bucketName,
prefix
)
// create the instance for the object content stream
const objectContentStream = new S3ObjectContentStream(
s3,
bucketName,
transformer
)
return pumpify(listBucketStream, objectContentStream)
}
module.exports = createS3stStream