bucket file storage for node.js
supports
- Amazon S3
TODO
- node.js-based server / client
- rackspace cloudfiles
- dropbox
- google drive
Simple Example
var filebucket = photosBucket = filebucket; photosBucket;
Server Example
var express = filebucket = ; var server = express; server; server;
client:
var fileBucket = var client = filebucket var photosBucket = client;
API
.get(bucketName, parameters)
returns a bucket representation
bucketName
- the name of the bucketparameters
- the parameters for the given bucket, including what service to use.
//dropboxvar photosBucket = filebucket; //s3var photosBucket = filebucket;
bucket.putFile(source, dest, onUpload)
stores a file in the given bucket
source
- the local, or remote source of the file.dest
- the destination of the fileonUpload
- called when a file is uploaded
bucket.putContent(content, dest, onUpload)
puts content into the destination file
content
- the file content
bucket.putStream(stream, dest, onUpload)
pipes a stream into the destination file
stream
- the file stream
var request = ; photoBucket;
Stream bucket.get(dest, onFile)
returns the bucket file
Stream bucket.remove(dest, onDelete)
removes the bucket file