Skip to content

djkmiles/meteor-s3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

S3

AWS S3 cloud file interface with automatic recursion

No need to initialize, as the class instantiates a single instance of itself when imported.

All methods are synchronous, [aws-sdk/clients/s3@2.9.0] wrapped in Meteor.wrapAsync

Installation

meteor add djk:s3

Environment variables or Meteor.settings are:

– S3_ID – S3_SECRET – S3_BUCKET – S3_REGION

Useage

upload(blob, path, type = 'text/plain')

Returns putObject data

example:

let html = '<!DOCTYPE html><html><head></head><body>Hello, world!</body></html>' let result = S3.upload(html, 'index.html', 'text/html')

erase(path)

Returns e.g. [{Key: }]

example:

S3.erase('foo/')

Erases foo/*

S3.erase('foo/1.txt')

Erases foo/1.txt

### copy(from, to)

Returns {from: , to: }

example:

S3.copy('foo/', 'bar/')

Copies foo/* to bar/

### move(from, to)

Returns {from: , to: }

example:

S3.copy('foo/', 'bar/')

Now foo/* is at bar/foo/*

list(path)

Returns

example:

S3.list('foo/bar/')

> [{Key: 'foo/bar/1.txt'}]

About

Simplistic S3 for Meteor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published