Microsoft Azure SDK for Node.js - Data Lake Store
This project provides a Node.js package that makes it easy to manage Azure Data Lake Store accounts.
Right now it supports:
- Node.js version: 6.x.x or higher
Features
- Account management: create, get, list, update, and delete.
- File system management: create, get, upload, append, download, read, delete, list.
How to Install
npm install azure-arm-datalake-store
How to Use
Authentication, account and filesystem client creation and listing file status as an example
var msRestAzure = ;var adlsManagement = ; // Interactive Login// It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful, // the user will get a DeviceTokenCredentials object.msRestAzure;
Create a Data Lake Store Account
var util = ;var resourceGroupName = 'testrg';var accountName = 'testadlsacct';var location = 'eastus2'; // account object to createvar accountToCreate = tags: testtag1: 'testvalue1' testtag2: 'testvalue2' location: location; clientaccount;
Create a file with content
var util = ;var accountName = 'testadlsacct';var fileToCreate = '/myfolder/myfile.txt';var options = streamContents: 'some string content' filesystemClientfileSystem;
Get a list of files and folders
var util = ;var accountName = 'testadlsacct';var pathToEnumerate = '/myfolder';filesystemClientfileSystem;