s3ls

Readable stream of object keys in a S3 bucket

npm install s3ls
21 downloads in the last month

s3ls

Readable stream of object keys in a S3 bucket. Listings with more items than the S3 maximum of 1000 are automagically paginated.

dependency status

Example

var s3ls = require('s3ls', {
  key: process.env.AWS_ACCESS_KEY,
  secret: process.env.AWS_SECRET_KEY,
  region: process.env.AWS_REGION,
  bucket: process.env.S3_BUCKET
});

s3ls('img').pipe(process.stdout);

Methods

var s3ls = require('s3ls')(opts);

The following opts must be passed in:

  • opts.key - AWS access key ID.
  • opts.secret - AWS secret access key.
  • opts.region - AWS geographic region.
  • opts.bucket - Existing S3 bucket for uploads.

var ls = s3ls(prefix)

Return a readable stream of object keys under the given prefix.

License

MIT

npm loves you