Socket
Book a DemoInstallSign in
Socket

s3-list-all

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

s3-list-all

get full list response from s3.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

s3-list-all

get full list response from s3. s3 limits listObjects responses to 1000 entries. you have to recursively call listObjects with the continuation token to get the whole result.

const listAll = require('s3-list-all')({accessKeyId:key,secretAccessKey:secret})

listAll({Bucket:bucket,Prefix:'2017-'},function(err,results){
  // if any requests error we callback with err and undefined result.

  console.log(results)
  console.log(results.length)

  //results is an array of all s3 response.Contents
  /*
  [  
  { Key: '2017-01-01T07:00:00.000.log',
    LastModified: 2017-01-01T07:00:02.000Z,
    ETag: '"0000000000000000000000000000000000-37"',
    Size: 194034009,
    StorageClass: 'STANDARD' },
    ...
  ]
  */
})

api

  • require('s3-list-all')(awsConfig) , default export.
    • pass a config object with at least aws accessKeyId and secretAccessKey. valid config options are in the aws-sdk documentation here.
    • returns function listAll
  • listAll(s3Config,cb)
    • s3 config options are here is the aws documentation. http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html

Keywords

s3

FAQs

Package last updated on 10 Jun 2017

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