Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/harrisiirak/webhdfs
Node.js WebHDFS REST API client
https://github.com/harrisiirak/webhdfs
hadoop javascript node-webhdfs webhdfs
Last synced: 3 days ago
JSON representation
Node.js WebHDFS REST API client
- Host: GitHub
- URL: https://github.com/harrisiirak/webhdfs
- Owner: harrisiirak
- License: mit
- Created: 2014-02-13T00:06:40.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-09-27T07:55:13.000Z (over 6 years ago)
- Last Synced: 2024-12-25T20:09:10.432Z (10 days ago)
- Topics: hadoop, javascript, node-webhdfs, webhdfs
- Language: JavaScript
- Homepage:
- Size: 56.6 KB
- Stars: 89
- Watchers: 7
- Forks: 42
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
node-webhdfs
============[![Build Status](https://travis-ci.org/harrisiirak/webhdfs.png?branch=master)](https://travis-ci.org/harrisiirak/webhdfs)
[![NPM version](https://badge.fury.io/js/webhdfs.png)](http://badge.fury.io/js/webhdfs)Hadoop WebHDFS REST API (2.2.0) client library for node.js with `fs` module like (asynchronous) interface.
## Examples
Writing to the remote file:
```javascript
var WebHDFS = require('webhdfs');
var hdfs = WebHDFS.createClient();var localFileStream = fs.createReadStream('/path/to/local/file');
var remoteFileStream = hdfs.createWriteStream('/path/to/remote/file');localFileStream.pipe(remoteFileStream);
remoteFileStream.on('error', function onError (err) {
// Do something with the error
});remoteFileStream.on('finish', function onFinish () {
// Upload is done
});
```Reading from the remote file:
```javascript
var WebHDFS = require('webhdfs');
var hdfs = WebHDFS.createClient({
user: 'webuser',
host: 'localhost',
port: 80,
path: '/webhdfs/v1'
});var remoteFileStream = hdfs.createReadStream('/path/to/remote/file');
remoteFileStream.on('error', function onError (err) {
// Do something with the error
});remoteFileStream.on('data', function onChunk (chunk) {
// Do something with the data chunk
});remoteFileStream.on('finish', function onFinish () {
// Upload is done
});
```## TODO
* Implement all calls (GETCONTENTSUMMARY, GETFILECHECKSUM, GETHOMEDIRECTORY, GETDELEGATIONTOKEN, RENEWDELEGATIONTOKEN, CANCELDELEGATIONTOKEN, SETREPLICATION, SETTIMES)
* Improve documentation
* More examples# Tests
Running tests:
```bash
npm test
```# License
MIT