2.0.3 • Published 6 years ago

node-nfsc v2.0.3

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
6 years ago

logo

node-nfsc

CircleCI

tl;dr

NFS client bindings for node.js

Using node-nfsc in your project

Install the dependencies krb5-multidev and libkrb5-dev.

And then,

$ npm install --save node-nfsc

Usage

First, import the node-nfsc function into your program:

const nfsc = require('node-nfsc');

Second, create an NFSv3 Client instance with the following arguments:

var my_stash = new nfsc.V3({
    host: 'example.com',
    exportPath: '/my_stash'
});

Third, mount the filesystem and play with your data:

let myfile_content;
my_stash.mount((err, root) => {
    if (err) {
        console.log(err);
        return;
    }
    my_stash.lookup(root, 'mydir', (err, mydir, mydir_attrs, root_attrs) => {
        if (err) {
            console.log(err);
            return;
        }
        my_stash.lookup(mydir, 'myfile', (err, myfile, myfile_attrs, mydir_attrs) => {
            if (err) {
                console.log(err);
                return;
            }
            my_stash.read(myfile,
                          myfile_attrs.size, 0,
                          (err, eof, buffer, myfile_attrs) => {
                if (err) {
                    console.log(err);
                    return;
                }
                myfile_content = buffer;
            });
        });
    });
});

Contributing

In order to contribute, please follow the Contributing Guidelines.

2.0.3

6 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago