mobiletto 1.0.24 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +12 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -12,6 +12,10 @@ Today the supported drivers are:
12
12
  * `s3`: read/write an Amazon S3 bucket
13
13
  * `local`: read/write to local filesystem
14
14
 
15
+ ### Source
16
+ * [Mobiletto on GitHub](https://github.com/cobbzilla/mobiletto)
17
+ * [Mobiletto on npm](https://www.npmjs.com/package/mobiletto)
18
+
15
19
  ## TLDR
16
20
  A simple CRUD example using the mobiletto S3 driver.
17
21
 
@@ -20,19 +24,21 @@ This code would run the same if the driver were `local`.
20
24
  const storage = require('mobiletto')
21
25
  const s3 = await storage.connect('s3', aws_key, aws_secret, {bucket: 'bk', region: 'us-east-1', cacheSize: 100})
22
26
 
23
- // returns array of metadata objects
27
+ // list objects: returns array of metadata objects
24
28
  const listing = await s3.list()
29
+ const dirList = await s3.list('some/dir/')
30
+ const everything = await s3.list('', {recursive: true})
25
31
 
26
32
  // write an entire file in one-shot
27
- await s3.writeFile('some/path', someBufferOfData)
33
+ let bytesWritten = await s3.writeFile('some/path', someBufferOfData)
28
34
 
29
- // write a stream
30
- const bytesWritten = await s3.write('some/path', streamOrGenerator)
35
+ // write a file from a stream/generator
36
+ bytesWritten = await s3.write('some/path', streamOrGenerator)
31
37
 
32
38
  // read an entire file in one-shot
33
- const objectData = await s3.readFile('some/path')
39
+ const byteBuffer = await s3.readFile('some/path')
34
40
 
35
- // read a stream
41
+ // read file as a stream using data callback
36
42
  const bytesRead = await s3.read('some/path', (chunk) => { ...do something with chunk... } )
37
43
 
38
44
  // remove a file, returns true upon success
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobiletto",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "A storage abstraction layer",
5
5
  "main": "index.js",
6
6
  "author": "Jonathan Cobb",