There are 5 generated JavaScript files for Azure Storage JavaScript Client Library:
azure-storage.common.js
contains the common part for other 4 JavaScript files.azure-storage.table.js
contains the Azure Storage table service operation logic, which depends on azure-storage.common.jsazure-storage.blob.js
contains the Azure Storage blob service operation logic, which depends on azure-storage.common.jsazure-storage.queue.js
contains the Azure Storage queue service operation logic, which depends on azure-storage.common.jsazure-storage.file.js
contains the Azure Storage file service operation logic, which depends on azure-storage.common.js
We also provide samples to guide you quickly start with the Azure Storage JavaScript Client Library. In the JavaScript Client Library zip file or azure-storage-node/browser/samples, you will find 4 HTML samples:
sample-table.html
demonstrates how to operate with Azure Storage table service in the browsersample-blob.html
demonstrates how to operate with Azure Storage blob service in the browsersample-queue.html
demonstrates how to operate with Azure Storage queue service in the browsersample-file.html
demonstrates how to operate with Azure Storage file service in the browser
After generating the JavaScript Client Library, you can try the samples in browsers such as Chrome/Edge/Firefox directly.
Note: An HTTP server should be set to host the samples for IE browser.
The Azure Storage JavaScript Client Library is currently in preview stage, there are some known issues or limitations as follows.
Compatibility with mobile browsers have not been fully validated, please open issues when you get errors. Current validated browsers are as below:
Chrome | Firefox | Internet Explorer | Microsoft Edge |
---|---|---|---|
v61 | v56 | v11 | v40 |
If you wish to customize the library and generate the Azure Storage JavaScript Client Library, you can follow the following steps.
We provide browserify bundle scripts which generate Azure Storage JavaScript Client Library. The bundle script reduces the size of the Storage Client Library by splitting into smaller files, one per storage service and a common shared file.
The generated JavaScript Client Library includes 5 separated JavaScript files:
azure-storage.common.js
azure-storage.table.js
azure-storage.blob.js
azure-storage.queue.js
azure-storage.file.js
Let's get started to generate the Azure Storage JavaScript Client Library!
Azure Storage JavaScript Client Library is generated from Azure Storage SDK for Node.js. Clone azure-storage-node
repo with following command:
git clone https://github.com/Azure/azure-storage-node.git
Change to the root directory of the cloned repo:
cd azure-storage-node
Install the dependent Node.js modules:
npm install
We provide bundle scripts to help quickly generate the JavaScript Client Library. At the root directory of the cloned repo:
npm run genjs
If everything goes well, the generated JavaScript files should be saved to azure-storage-node/browser/bundle
. There will be 5 generated JavaScript files totally:
azure-storage.common.js
azure-storage.table.js
azure-storage.blob.js
azure-storage.queue.js
azure-storage.file.js
You are able to minify the generated JavaScript files with your favorite minify tools. Here we show the minify process with Node.js minify tool uglifyJS.
Install uglifyJS:
npm install -g uglify-js
Minify the JavaScript files:
uglifyjs --compress --mangle -- azure-storage.common.js > azure-storage.common.min.js
uglifyjs --compress --mangle -- azure-storage.table.js > azure-storage.table.min.js
uglifyjs --compress --mangle -- azure-storage.blob.js > azure-storage.blob.min.js
uglifyjs --compress --mangle -- azure-storage.queue.js > azure-storage.queue.min.js
uglifyjs --compress --mangle -- azure-storage.file.js > azure-storage.file.min.js