@vtfk/azure-storage-blob
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@vtfk/azure-storage-blob", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Convenience wrapper around @azure/storage-blob", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
# (WIP) azure-blob-storage | ||
Convenience wrapper around [@azure/storage-blob](https://www.npmjs.com/package/@azure/storage-blob) | ||
High-level API in front of [@azure/storage-blob](https://www.npmjs.com/package/@azure/storage-blob) | ||
@@ -19,3 +19,3 @@ # Install | ||
Storage accounts -> <Your Storage account> -> Shared access signature | ||
Storage accounts -> Your Storage account -> Shared access signature | ||
@@ -29,2 +29,5 @@ Generate a SAS with desired `start` and `end` time. | ||
connectionString: '<BLOB_SERVICE_SAS_URL>' | ||
/* optional timeout in ms | ||
timeout: 30 * 1000 | ||
*/ | ||
}) | ||
@@ -39,3 +42,3 @@ ``` | ||
```js | ||
const { containerItems } = await storage.listContainers() | ||
const { containerItems } = await storage.list() | ||
``` | ||
@@ -46,9 +49,9 @@ | ||
```js | ||
await storage.createContainer('containername') | ||
await storage.create('containername') | ||
``` | ||
### Delete a container | ||
### Remove a container | ||
```js | ||
await storage.deleteContainer('containername') | ||
await storage.remove('containername') | ||
``` | ||
@@ -67,3 +70,3 @@ | ||
```js | ||
const { segment: { blobItems } = await container.listBlob() | ||
const { segment: { blobItems } } = await container.list() | ||
``` | ||
@@ -74,3 +77,3 @@ | ||
```js | ||
await container.writeTextBlob('test.json', JSON.stringify({ text: 'One thought fills immensity.' })) | ||
await container.writeText('test.json', JSON.stringify({ text: 'One thought fills immensity.' })) | ||
``` | ||
@@ -81,9 +84,9 @@ | ||
```js | ||
const content = await container.readBlob('test.json') | ||
const content = await container.readFile('test.json') | ||
``` | ||
### Delete blob | ||
### Remove blob | ||
```js | ||
await container.deleteBlob('test.json') | ||
await container.removeFile('test.json') | ||
``` | ||
@@ -103,7 +106,4 @@ | ||
# License | ||
[MIT](LICENSE) |
@@ -81,3 +81,3 @@ const { | ||
function deleteBlob (filename) { | ||
function removeBlob (filename) { | ||
if (!filename) { | ||
@@ -91,5 +91,5 @@ throw Error('Filename missing') | ||
return { | ||
listContainers, | ||
createContainer: name => createContainer(name), | ||
deleteContainer: name => deleteContainer(name), | ||
list: () => listContainers, | ||
create: name => createContainer(name), | ||
remove: name => deleteContainer(name), | ||
container: containerName => { | ||
@@ -101,6 +101,6 @@ if (!containerName) { | ||
return { | ||
listBlob, | ||
readBlob: filename => readBlob(filename), | ||
deleteBlob: filename => deleteBlob(filename), | ||
writeTextBlob: (filename, content) => writeTextBlob(filename, content) | ||
list: () => listBlob, | ||
readFile: filename => readBlob(filename), | ||
removeFile: filename => removeBlob(filename), | ||
writeText: (filename, content) => writeTextBlob(filename, content) | ||
} | ||
@@ -107,0 +107,0 @@ } |
6644