@gyselroth/balloon-node-fuse

1.0.0-alpha10 • Public • Published

balloon FUSE bindings for node.js

Build Status GitHub release npm GitHub license

Install

npm install --save @gyselroth/balloon-node-fuse
npm install --save @gyselroth/balloon-sdk-node

Requirements

balloon-node-fuse requires an instance of @gyselroth/balloon-sdk-node.

Note: balloon-node-fuse requires fuse-bindings internally which itself requires a native fuse dependency. if balloon-node-fuse is somewhat packaged into a binary (For example via electron, nexe, ...) this dependency must be included. On Linux you may install the fuse package from your distribution. On Windows Dokany is required and on OS X osxfuse.

Usage

import { CoreV2Api, HttpBasicAuth } from '@gyselroth/balloon-sdk-node';
import { mount } from '@gyselroth/balloon-node-fuse';

var client = new CoreV2Api(args.server);

var basic = new HttpBasicAuth();
basic.username = 'admin';
basic.password = 'admin';
client.setDefaultAuthentication(basic);
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';

var config = {
  mountPoint: '/media/balloon',
};

mount(client, config).then(result => {
  console.log('balloon mounted');
}).catch(error => {
  console.log('mount error %s', error);
});

Install fuse

balloon-node-fuse requires fuse. This is usually installed on Linux based systems. On windows, dokany provides the necessary fuse bindings. dokany may be installed automatically using balloon-node-fuse. The same applies to OS X, there is no fuse by default but can be installed using the provided options.

import { install } from '@gyselroth/balloon-node-fuse';

install().then(result => {
  console.log("fuse installed");
}).catch(error => {
  console.log('install %s', error);
});

Options

Option Type Default Description
mountPoint null (Required) Path where balloon should be mounted.
cacheDir null Path to directory where an offline cache is located.
cacheTTL 5 Cache time in seconds for node response TTL.
on null Event binder to handle fuse events.

Events

You may bind a callback to handle each fuse event individually:

var config = {
  mountPoint: '/media/balloon',
  on: function(e) {
    console.log('fuse event', e);
  }
};

mount(client, config);

Readme

Keywords

none

Package Sidebar

Install

npm i @gyselroth/balloon-node-fuse

Weekly Downloads

0

Version

1.0.0-alpha10

License

MIT

Unpacked Size

7.83 MB

Total Files

23

Last publish

Collaborators

  • laura.kohli
  • dragan.jevdjovic
  • dragoljub.popovic
  • ovidio.raimondi
  • ewald.kleefstra
  • mahmoud.sino
  • marius.weber
  • pixtron
  • npm-gyselroth
  • mmhann
  • philippenahlik
  • grfreelancer1
  • grfreelancer2
  • luca.marra
  • s-aebischer