This package has been deprecated

Author message:

This package has been replaced by @azure/storage-file-datalake

@azure/storage-datalake
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Azure DataLakeStorageClient SDK for JavaScript

This package contains an isomorphic SDK for DataLakeStorageClient.

Currently supported environments

  • Node.js version 6.x.x or higher
  • Browser JavaScript

How to Install

npm install @azure/storage-datalake

How to use

nodejs - Authentication, client creation and list filesystem as an example written in TypeScript.

Sample code

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);
  });

browser - Authentication, client creation and list filesystem as an example written in JavaScript.

Sample code
  • 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>

Related projects

Impressions

Package Sidebar

Install

npm i @azure/storage-datalake

Weekly Downloads

7

Version

0.2.0

License

MIT

Unpacked Size

694 kB

Total Files

59

Last publish

Collaborators

  • microsoft1es
  • amarzavery
  • vladbarosan
  • veronicagg
  • azure-sdk