22
33Amazon S3 [ abstract-blob-store] ( http://npmrepo.com/abstract-blob-store )
44
5-
65[ ![ blob-store-compatible] ( https://raw.githubusercontent.com/maxogden/abstract-blob-store/master/badge.png )] ( https://github.com/maxogden/abstract-blob-store )
76
87## Installation
@@ -35,6 +34,11 @@ fs.createReadStream('/tmp/somefile.txt')
3534store .createReadStream ({ key: ' somefile.txt' })
3635 .pipe (fs .createWriteStream (' /tmp/somefile.txt' ));
3736
37+ // remove
38+ store .remove ({ key: ' somefile.txt' }, function (err ) {
39+ // ...
40+ });
41+
3842// exists
3943store .exists ({ key: ' somefile.txt' }, function (err , exists ) {
4044 // ...
@@ -43,33 +47,115 @@ store.exists({ key: 'somefile.txt' }, function (err, exists) {
4347
4448## API
4549
46- ### ` var s3 = require('s3-blob-store')(options) `
50+ <!-- Generated by documentation.js. Update this documentation by updating the source code. -->
51+
52+ #### Table of Contents
53+
54+ - [ S3BlobStore] ( #s3blobstore )
55+ - [ Parameters] ( #parameters )
56+ - [ createReadStream] ( #createreadstream )
57+ - [ Parameters] ( #parameters-1 )
58+ - [ createWriteStream] ( #createwritestream )
59+ - [ Parameters] ( #parameters-2 )
60+ - [ remove] ( #remove )
61+ - [ Parameters] ( #parameters-3 )
62+ - [ exists] ( #exists )
63+ - [ Parameters] ( #parameters-4 )
64+ - [ WriteParams] ( #writeparams )
65+ - [ Options] ( #options )
66+ - [ Properties] ( #properties )
67+ - [ ReadStreamOptions] ( #readstreamoptions )
68+ - [ S3] ( #s3 )
69+ - [ ReadParams] ( #readparams )
70+
71+ ### S3BlobStore
72+
73+ Create S3 blob store
74+
75+ #### Parameters
76+
77+ - ` opts ` ** [ Object] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object ) **
78+ - ` opts.client ` ** [ S3] ( #s3 ) ** S3 client
79+ - ` opts.bucket ` ** [ String] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) ** bucket name
80+
81+ #### createReadStream
82+
83+ Create read stream
84+
85+ ##### Parameters
86+
87+ - ` opts ` ** ([ ReadStreamOptions] ( #readstreamoptions ) \| [ String] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) )** options or object key
88+
89+ Returns ** ReadableStream** readable stream of data for the file in your bucket whose key matches
90+
91+ #### createWriteStream
92+
93+ Create write stream
94+
95+ ##### Parameters
96+
97+ - ` opts ` ** ([ Options] ( #options ) < ; [ WriteParams] ( #writeparams ) > | [ String] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) )** options or object key
98+ - ` s3opts `
99+ - ` done ` ** function ([ Error] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error ) , {key: [ String] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) })** callback
100+
101+ Returns ** WritableStream** writable stream that you can pipe data to
102+
103+ #### remove
104+
105+ Remove object from store
106+
107+ ##### Parameters
108+
109+ - ` opts ` ** ({key: [ String] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) } | [ String] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) )** options containing object key or just key
110+ - ` done ` ** function ([ Error] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error ) )** callback
111+
112+ #### exists
113+
114+ Check if object exits
115+
116+ ##### Parameters
117+
118+ - ` opts ` ** ({key: [ String] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) } | [ String] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) )** options containing object key or just key
119+ - ` done ` ** function ([ Error] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error ) , [ Boolean] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean ) )** callback
120+
121+ ###
122+
123+ ### WriteParams
124+
125+ - ** See: < https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#putObject-property > **
126+
127+ S3 ` putObject ` params
128+
129+ ### Options
130+
131+ Type: [ Object] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object )
132+
133+ #### Properties
47134
48- ` options ` must be an object that has the following properties:
135+ - ` key ` ** [ String] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) ** object key
136+ - ` name ` ** [ String] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) ?** ` key ` alias
137+ - ` filename ` ** [ String] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) ?** ` key ` alias
138+ - ` params ` ** S3Params?** additional S3 options
49139
50- - ` client ` : an ` require('aws-sdk').S3 ` instance
51- - ` bucket ` : your bucket
140+ ### ReadStreamOptions
52141
53- ### ` s3.createWriteStream(opts, cb) `
142+ - ** See: < https://github.com/jb55/s3-download-stream#api > **
54143
55- returns a writable stream that you can pipe data to.
144+ [ ` Options ` ] ( #options ) including ` s3- stream-download ` configuration
56145
57- ` opts ` should be an object that has options ` key ` (will be the filename in
58- your bucket)
146+ ### S3
59147
60- ` opts.params ` additional [ parameters ] ( http: //docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#putObject-property ) to pass to S3
148+ - ** See: < https: //docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html> **
61149
62- ` cb ` will be called with ` (err) ` if there is was an error
150+ S3 client
63151
64- ### ` s3.createReadStream(opts) `
152+ ### ReadParams
65153
66- ` opts ` should be ` { key: string (usually a hash or path + filename) } `
154+ - ** See: < https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#getObject-property > **
67155
68- ` opts.params ` additional [ parameters] ( http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#getObject-property ) to pass to S3
69- ` opts.concurrency ` optional parameter for [ s3-download-stream] ( https://github.com/jb55/s3-download-stream )
70- ` opts.chunkSize ` optional parameter for [ s3-download-stream] ( https://github.com/jb55/s3-download-stream )
156+ S3 ` getObject ` params
71157
72- returns a readable stream of data for the file in your bucket whose key matches
158+ ###
73159
74160## License
75161
0 commit comments