digger-bundle

0.0.4 • Public • Published

digger-bundle

Build status

A bundle of digger modules that make up the standard container API.

install

$ npm install digger-bundle

usage

The module exports a digger-container but with the prototype augmented with find, selector and contract modules.

var Container = require('digger-bundle');
 
// make containers as normal
var container = Container([{
  _digger:{
    tag:'fruit',
    diggerwarehouse:'/api1',
    diggerpath:[10]
  }
}])
 
// the prototype has the find api so we can search
var results = container.find('fruit');
results.count().should.equal(1);
 
// it also has contracts so we can select
var contract = container('yo');
 
contract.url.should.equal('/api1/select');
contract.method.should.equal('post');
 
// and XML so we can parse XML strings
var xmlcontainer = Bundle('<folder name="xml" />');
 
container.append(xmlcontainer);
 
var folderresult = container.find('folder');
 
folderresult.count().should.equal(1);
 
// radio is there so we can pub/sub
var radio = container.radio();
 
radio.listen('apple', function(packet){
  packet.should.equal(10);
  done();
})
 
radio.receive('api1.10.apple', 10);

licence

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    1
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i digger-bundle

Weekly Downloads

1

Version

0.0.4

License

MIT

Last publish

Collaborators

  • binocarlos