MyGit

goodeggs/knox-copy

Fork: 9 Star: 13 (更新于 2024-11-23 03:20:12)

license: 暂无

Language: CoffeeScript .

Extends the Knox Node Amazon S3 client to support copying and listing buckets

GitHub网址

knox-copy

Dependency Status

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 = knoxCopy.createClient
  key: '<api-key-here>'
  secret: '<secret-here>'
  bucket: 'mrbucket'

client.streamKeys(prefix: 'buckets/of/fun')
.on 'data', (key) -> console.log key

Backup a bucket full of uploads:

knoxCopy = require 'knox-copy'

client = knoxCopy.createClient
  key: '<api-key-here>'
  secret: '<secret-here>'
  bucket: 'backups'

client.copyBucket
  fromBucket: 'uploads'
  fromPrefix: '/nom-nom'
  toPrefix: "/upload_backups/#{new Date().toISOString()}"
  (err, count) ->
     console.log "Copied #{count} 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:

{
  "key":"<api-key-here>",
  "secret":"<secret-here>",
  "bucket":"<your-bucket-name>"
}

Then install the dev dependencies and execute the test suite:

$ npm install
$ npm test

最近版本更新:(数据更新于 1970-01-01 00:00:00)

goodeggs/knox-copy同语言 CoffeeScript最近更新仓库

2016-09-02 09:32:40 chinakids/atom-simplified-chinese-menu

2014-12-05 15:06:20 audiocogs/aurora.js

1970-01-01 00:00:00 shadowsocks/shadowsocks-chromeapp

1970-01-01 00:00:00 daraosn/oculus-drone

1970-01-01 00:00:00 tdreyno/iphone-style-checkboxes

1970-01-01 00:00:00 shadowsocks/shadowsocks-gui