mumba-file-storage
v0.2.8
Published
Interfaces for dealing with files.
Downloads
12
Readme
Mumba File Storage
Interfaces for dealing with files.
Installation
$ npm install --save mumba-file-storage
S3 Example
import {S3FileStorageService} from `mumba-file-storage`;
import {S3} from 'aws-sdk';
let tmpDir = __dirname + '/tmp';
let options = {
Bucket: 'the-bucket',
tmpDir: tmpDir
};
let s3Options = {
tmpDir: tmpDir,
accessKeyId: '',
secretAccessKey: '',
Bucket: 'the-bucket',
ACL: 'private',
ServerSideEncryption: 'AES256'
};
let awsS3 = new S3(s3Options);
let instance = new S3FileStorageService(options, awsS3);
instance.getFile('/path/to/object');
instance.putFile(`${tmpDir}/file`, '/path/to/object');
instance.moveFile('/path/to/original/file', '/path/to/new/location');
Tests
To run the test suite, first install the dependencies, then run npm test
:
$ npm install
$ npm test
People
The original author of Mumba File Storage is Scott Robinson.
License
© 2016 Mumba Pty Ltd. All rights reserved.