New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

s3tree

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

s3tree

Hierarchical object listing on S3

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

s3tree

Hierarchical object listing on S3.

dependency status

Example

Given the following objects on S3:

2012/12/24/23-12-09.jpg
2013/02/31/14-00-04.jpg
2013/09/05/20-45-10.jpg
2013/09/05/20-45-12.jpg
2013/09/06/21-03-42.jpg
2013/10/25/09-51-33.jpg

s3tree can list the hierarcy with:

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

tree('', function (err, years) {
  years.forEach(function (year) {
    tree(year, function (err, months) {
      console.log(months.join(' '));
    });
  });
});

which will output:

2012/12/
2013/02/ 2013/09/ 2013/10/

With the hierarcy mapped it's easy to stream all object keys of a given year, month, or day with s3ls.

Methods

var s3tree = 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.

s3tree(prefix, cb(err, prefixes) {})

Provide a callback which will be called with an error err or the prefixes under the given prefix.

License

MIT

Keywords

s3

FAQs

Package last updated on 02 Oct 2013

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