Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit 489f0bf

Browse files
committed
Updated documentation
1 parent ac2d9ce commit 489f0bf

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ $ npm install datastore-s3
2626
```
2727

2828
## Usage
29-
A bucket must be created prior to using datastore-s3. Please see the AWS docs for information on how to configure the S3 instance. A bucket name is required to be set at the s3 instance level, see the below example.
29+
If the flag `createIfMissing` is not set or is false, then the bucket must be created prior to using datastore-s3. Please see the AWS docs for information on how to configure the S3 instance. A bucket name is required to be set at the s3 instance level, see the below example.
3030

3131
```js
3232
const S3 = require('aws-sdk').S3
3333
const s3Instance = new S3({ params: { Bucket: 'my-ipfs-bucket' } })
3434
const S3Store = require('datastore-s3')
3535
const store = new S3Store('.ipfs/datastore', {
3636
s3: s3Instance
37+
createIfMissing: false
3738
})
3839
```
3940

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ const Deferred = require('pull-defer')
1515
const pull = require('pull-stream')
1616

1717
/* :: export type S3DSInputOptions = {
18-
s3: S3Instance
18+
s3: S3Instance,
19+
createIfMissing: ?boolean
1920
}
2021
2122
declare type S3Instance = {
@@ -43,6 +44,7 @@ class S3Datastore {
4344
/* :: path: string */
4445
/* :: opts: S3DSInputOptions */
4546
/* :: bucket: string */
47+
/* :: createIfMissing: boolean */
4648

4749
constructor (path /* : string */, opts /* : S3DSInputOptions */) {
4850
this.path = path

0 commit comments

Comments
 (0)