knox-copy
Extends the Knox Node Amazon S3 client to support copying and listing arbitrarily large buckets. Transparently streams keys and copies files from buckets that exceed Amazon's 1000 key page size limit.
Install
npm install knox-copy
Examples
Stream the keys of all the files in a bucket:
knoxCopy = require 'knox-copy'client = knoxCopycreateClientkey: '<api-key-here>'secret: '<secret-here>'bucket: 'mrbucket'clientstreamKeysprefix: 'buckets/of/fun'on 'data' consolelog key
Backup a bucket full of uploads:
knoxCopy = require 'knox-copy'client = knoxCopycreateClientkey: '<api-key-here>'secret: '<secret-here>'bucket: 'backups'clientcopyBucketfromBucket: 'uploads'fromPrefix: '/nom-nom'toPrefix: "/upload_backups/"consolelog "Copied files"
Running Tests
Setup tests as with knox. You must first have an S3 account, and create a file named ./auth, which contains your credentials as json, for example:
Then install the dev dependencies and execute the test suite:
$ npm install
$ npm test