bionet-client
A client library for connecting to a bionet server
Last updated 2 years ago by juul .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install bionet-client 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.0.2                                ...           latest (2 years ago)

2 Versions

  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (4)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |