This package contains an isomorphic SDK for DataLakeStorageClient.
- Node.js version 6.x.x or higher
- Browser JavaScript
npm install @azure/storage-datalake
This sample lists the file systems in your storage account. To know more, refer to the Azure Documentation on Storage DataLake
import * as msRest from "@azure/ms-rest-js";
import { DataLakeStorageClient } from "@azure/storage-datalake";
const token = "YOUR_STORAGE_TOKEN";
const credentials = new msRest.TokenCredentials(token);
const accountName = "YOUR_STORAGE_ACCOUNTNAME";
const client = new DataLakeStorageClient(credentials, accountName);
client.filesystem
.list()
.then(results => {
results.forEach(result => {
console.log(`Name: ${result.name}`);
console.log(`Last Modified: ${result.lastModified}`);
});
})
.catch(ex => {
console.log(ex);
});
- index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>@azure/storage-datalake sample</title>
<script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script>
<script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
<script src="node_modules/@azure/storage-datalake/dist/storage-datalake.js"></script>
<script type="text/javascript">
const token = "YOUR_STORAGE_TOKEN";
const credentials = new msRest.TokenCredentials(token);
const accountName = "YOUR_STORAGE_ACCOUNTNAME";
const client = new Azure.StorageDatalake.DataLakeStorageClient(
credentials,
accountName
);
client.filesystem
.list()
.then(results => {
results.forEach(result => {
console.log(`Name: ${result.name}`);
console.log(`Last Modified: ${result.lastModified}`);
});
})
.catch(ex => {
console.log(ex);
});
</script>
</head>
<body></body>
</html>