Members
Methods
(async) delete(value) → {Promise.<(Object|Error)>}
Delete object from S3 bucket.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
String
|
Object name/prefix. |
Returns:
- Type:
-
Promise.<(Object|Error)>
Example
await client.delete('/path/to/keyName');
(async) exists(value) → {Promise.<(Object|Boolean|Error)>}
Check object exists in S3 bucket.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
String
|
Object Prefix as string. |
Returns:
- Type:
-
Promise.<(Object|Boolean|Error)>
Example
const exists = await client.exists('/path/to/keyName');
(async) fetch(value) → {Promise.<(Object|Error)>}
Fetch object from S3 bucket.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
String
|
Object Prefix. |
Returns:
- Type:
-
Promise.<(Object|Error)>
Example
const data = await client.fetch('/path/to/keyName');
(async) list(prefix) → {Promise.<(Array|Error)>}
List objects in a S3 bucket.
Parameters:
| Name | Type | Description |
|---|---|---|
prefix |
String
|
Object Prefix. |
Returns:
- Type:
-
Promise.<(Array|Error)>
Example
const objects = await client.list('/path/to/objects');
// ['foo.ext', 'bar.ext', 'biz.ext', 'baz.ext']
(async) rename(oldValue, newValue) → {Promise.<(Object|Error)>}
Rename object in S3 bucket.
Parameters:
| Name | Type | Description |
|---|---|---|
oldValue |
String
|
Old object Prefix as string. |
newValue |
String
|
New object Prefix as string. |
Returns:
- Type:
-
Promise.<(Object|Error)>
Example
await client.rename('/path/to/keyName1', '/path/to/keyName2');
(async) write(value, data, options) → {Promise.<(Object|Error)>}
Write/overwrite object in S3 bucket.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
String
|
Object Prefix. |
data |
String
|
Buffer
|
Object data. |
options |
Object.<(contentType|metaData)>
|
Request options. |
Returns:
- Type:
-
Promise.<(Object|Error)>
Example
await client.write('/path/to/keyName', 'foo', 'text/plain');