3.0.0 • Published 10 years ago

digger-client v3.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

digger-client

Connect to a digger server and run selectors

installation

$ npm install digger-client

usage

// the supplychain is what connects our digger client with the transport
var supplychain = require('digger-client')();

// the transport is a function that handles the request and response streams
// this can move them over a network or pass them to a local digger server
supplychain.on('request', function(req, res){
	// req is a readable stream
	// res is a writable stream
})

Or make a HTTP connected client:

var supplychain = require('digger-client').http('http://localhost:8080/digger');

Now we have a supplychain hooked up to a transport - we can create containers:

// connect to a warehouse on a path
var warehouse = supplychain.connect('/my/warehouse');

ship requests can send complicated contracts with multiple inputs but cannot stream

they collect all the results into an array and pass them to your callback:

// run a selector to that warehouse
warehouse('product[price<100]')
	.ship(function(products){
		console.log(products.count() + ' products loaded');
	})

stream requests can send only one source of input but can stream

warehouse('product[price<100]')
	.stream()
	.through(function(model){
		console.dir(model);
	})

licence

MIT

3.0.0

10 years ago

2.6.2

10 years ago

2.6.1

10 years ago

2.6.0

10 years ago

2.5.0

10 years ago

2.4.0

10 years ago

2.2.0

10 years ago

2.1.2

10 years ago

2.1.1

10 years ago

2.1.0

10 years ago

2.0.0

10 years ago

1.0.0

10 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago