digger-client

A bundle of digger-* modules that works well as a basic client for digger.io warehouses

npm install digger-client
23 downloads in the last week
50 downloads in the last month

digger-client

Build status

Client for a digger network.

Combines digger-bundle with digger-supplychain

install

$ npm install digger-client

usage

The module returns a supplychain object that emits the following events:

  • request
  • radio:talk
  • radio:listen
  • radio:cancel

You 'connect' to get a container that is pointing at a warehouse path:

var Client = require('digger-client');

var $digger = Client();

$digger.on('request', function(req, reply){
    // deal with the request somehow
})

// connect to the supplychain - this returns a container with _digger.diggerurl = '/db1'
var container = $digger.connect('/db1');

// run a selector via the container - this runs the request to the supplychain above
container('some.selector').ship(function(results){

    // digger-find is included so we can search local results
    console.log(results.find('#thing3').summary());
})

licence

MIT

npm loves you