Network Performance Monitor
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

bionet-client

0.0.2 • Public • Published

This is a client library for connecting to a bionet node.

Usage

To establish an unauthenticated RPC connection:

var bc = require('bionet-client');

bc("https://endylab.stanford.edu", function(err, done, remote) {
  if(err) return console.error(err);

  remote.doSomething(function(err, result) {
    if(err) return console.error(err);

    console.log("the server said:", result);

    done(); // close RPC connection
  });

});

To establish an authenticated RPC connection simply supply username and password:

bc("https://endylab.stanford.edu", {
  username: 'myuser',
  password: 'mypassword'
}, function(err, done, remote, userData, token) {

  // note that we're now receving the extra arguments:
  // * userData: object containing info about logged-in user
  // * token: authentication token

});

The connection is established using rpc-multistream which allows calling remote synchronous functions that return streams and functions with asynchronous callbacks that give streams as arguments.

The authentication is handled by rpc-multiauth.

Testing

Beware that testing requires a running bionet node to test against.

Copyright and license

Copyright 2016-2018 BioBricks Foundation

License: AGPLv3

Keywords

none

Install

npm i bionet-client

DownloadsWeekly Downloads

1

Version

0.0.2

License

none

Unpacked Size

7.56 kB

Total Files

8

Last publish

Collaborators

  • avatar
  • avatar
  • avatar