@azure/storage-blob
Advanced tools
Comparing version 12.0.1-dev.20191203.1 to 12.0.1-dev.20191204.1
{ | ||
"name": "@azure/storage-blob", | ||
"sdk-type": "client", | ||
"version": "12.0.1-dev.20191203.1", | ||
"version": "12.0.1-dev.20191204.1", | ||
"description": "Microsoft Azure Storage SDK for JavaScript - Blob", | ||
@@ -6,0 +6,0 @@ "main": "./dist/index.js", |
@@ -348,3 +348,3 @@ # Azure Storage Blob client library for JavaScript | ||
const containerClient = blobServiceClient.getContainerClient(containerName); | ||
let i = 1; | ||
@@ -407,19 +407,18 @@ let iter = await containerClient.listBlobsFlat(); | ||
### Download a blob and convert it to a string (Browsers) | ||
### Download a blob and convert it to a string (Browsers). | ||
Please refer to the [JavaScript Bundle](#javascript-bundle) section for more information on using this library in the browser. | ||
```javascript | ||
const { DefaultAzureCredential } = require("@azure/identity"); | ||
const { BlobServiceClient } = require("@azure/storage-blob"); | ||
const account = "<account>"; | ||
const defaultAzureCredential = new DefaultAzureCredential(); | ||
const account = "<account name>"; | ||
const sas = "<service Shared Access Signature Token>"; | ||
const containerName = "<container name>"; | ||
const blobName = "<blob name>" | ||
const blobServiceClient = new BlobServiceClient( | ||
`https://${account}.blob.core.windows.net`, | ||
defaultAzureCredential | ||
`https://${account}.blob.core.windows.net${sas}` | ||
); | ||
const containerName = "<container name>"; | ||
const blobName = "<blob name>" | ||
async function main() { | ||
@@ -439,7 +438,7 @@ const containerClient = blobServiceClient.getContainerClient(containerName); | ||
// [Browsers only] A helper method used to convert a browser Blob into string. | ||
async function blobToString(blob: Blob): Promise<string> { | ||
async function blobToString(blob){ | ||
const fileReader = new FileReader(); | ||
return new Promise<string>((resolve, reject) => { | ||
fileReader.onloadend = (ev: any) => { | ||
resolve(ev.target!.result); | ||
return new Promise((resolve, reject) => { | ||
fileReader.onloadend = (ev) => { | ||
resolve(ev.target.result); | ||
}; | ||
@@ -446,0 +445,0 @@ fileReader.onerror = reject; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4904545
487