{"_id":"strong-pubsub-bridge","_rev":"62-d308b3f2a2dcf1dd21efdf2700f970fc","name":"strong-pubsub-bridge","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"strong-pubsub-bridge","version":"0.1.0","author":{"name":"Ritchie Martori"},"license":{"url":"https://github.com/strongloop/strong-pubsub-bridge/blob/master/LICENSE","name":"Dual MIT/StrongLoop"},"_id":"strong-pubsub-bridge@0.1.0","maintainers":[{"name":"ritch","email":"skawful@gmail.com"}],"dist":{"shasum":"9f3a89e8da0250728be3b2c125607da18811b25a","tarball":"https://registry.npmjs.org/strong-pubsub-bridge/-/strong-pubsub-bridge-0.1.0.tgz","integrity":"sha512-zKxF7u9Z7SFl+Z8+2uuhjtzS76bUlOkyMVfJXVokzpeglsKL2mBzw2XnKVHY2VvDYqCrDgoLNZebx20Pvy7mgQ==","signatures":[{"sig":"MEYCIQCUL6XNGHPECaQ5htWheeASQtWaLo56cLSUTbkltewsQwIhALO5/2AaWBloqQJJyOGYT8zr7TL1KGPRO+ej7Q7lgVDL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"9f3a89e8da0250728be3b2c125607da18811b25a","gitHead":"01b0289cec7014b7675fd3021e84612c28cdf95a","scripts":{"test":"mocha"},"_npmUser":{"name":"ritch","email":"skawful@gmail.com"},"_npmVersion":"2.5.1","description":"Create a bridge between pubsub clients and brokers","directories":{},"_nodeVersion":"0.12.0","dependencies":{"debug":"^2.1.2"},"devDependencies":{"mocha":"^2.2.1","strong-pubsub-test":"^0.0.0"}},"0.1.1":{"name":"strong-pubsub-bridge","version":"0.1.1","author":{"name":"Ritchie Martori"},"license":{"url":"https://github.com/strongloop/strong-pubsub-bridge/blob/master/LICENSE","name":"Dual MIT/StrongLoop"},"_id":"strong-pubsub-bridge@0.1.1","maintainers":[{"name":"ritch","email":"skawful@gmail.com"}],"dist":{"shasum":"306cb11fc3b94bbceaca64b4aeb3b6a163688e70","tarball":"https://registry.npmjs.org/strong-pubsub-bridge/-/strong-pubsub-bridge-0.1.1.tgz","integrity":"sha512-WqWzctoIBf8DQpQwlvTdacm4dBDMj+iBMi3ReX5SV7EsvvzfQQAomTibaHRA6AEe5oA7inCiHb514yrLBsemXw==","signatures":[{"sig":"MEYCIQDu9jeRPSdsRJtSTm39CEcW4FqQIEX4sSmRAMfYl0iuxQIhAJ2en2kUFRnRlEpmKQPsCiXSUtIW+UplQ0/98aP3Pg6s","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"306cb11fc3b94bbceaca64b4aeb3b6a163688e70","gitHead":"36bed581c01a5dc77b1c051dd07e0412a90662e0","scripts":{"test":"mocha"},"_npmUser":{"name":"ritch","email":"skawful@gmail.com"},"_npmVersion":"2.5.1","description":"Create a bridge between pubsub clients and brokers","directories":{},"_nodeVersion":"0.12.0","dependencies":{"debug":"^2.1.2"},"devDependencies":{"mocha":"^2.2.1","strong-pubsub-test":"^0.0.0"}},"0.2.0":{"name":"strong-pubsub-bridge","version":"0.2.0","author":{"name":"Ritchie Martori"},"license":{"url":"https://github.com/strongloop/strong-pubsub-bridge/blob/master/LICENSE","name":"Dual MIT/StrongLoop"},"_id":"strong-pubsub-bridge@0.2.0","maintainers":[{"name":"ritch","email":"skawful@gmail.com"}],"dist":{"shasum":"3073e58d9f6c6039d3eeea59e6def0ecabac015c","tarball":"https://registry.npmjs.org/strong-pubsub-bridge/-/strong-pubsub-bridge-0.2.0.tgz","integrity":"sha512-woJd4TquhIREvvBbiiC3oCXiGaVWLnTOQopIXnBq2nO/KGy0s0226ZdrNUHnnQa/otrqt4TTbejFx9KR0/rPBQ==","signatures":[{"sig":"MEUCIQDHu2oSj/0E5YZ2oK+WZlR1E3kA5lqqwvQwYMVlQodpiwIgfqZ7jG9VL2GIEp6O0RbvCpAlGU7lOYW17kvltxHPozU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"3073e58d9f6c6039d3eeea59e6def0ecabac015c","gitHead":"b823fbd250e97d4f41adecefb31fb34637c4a950","scripts":{"test":"mocha"},"_npmUser":{"name":"ritch","email":"skawful@gmail.com"},"_npmVersion":"2.5.1","description":"Create a bridge between pubsub clients and brokers","directories":{},"_nodeVersion":"0.12.0","dependencies":{"debug":"^2.1.2"},"devDependencies":{"mocha":"^2.2.1","strong-pubsub-test":"^0.0.0"}},"0.2.1":{"name":"strong-pubsub-bridge","version":"0.2.1","author":{"name":"Ritchie Martori"},"license":"MIT","_id":"strong-pubsub-bridge@0.2.1","maintainers":[{"name":"bajtos","email":"mbajtoss@gmail.com"},{"name":"chandadharap","email":"chanda_dharap@yahoo.com"},{"name":"ibmcloud-admin","email":"rmg@ca.ibm.com"},{"name":"kraman","email":"kraman@gmail.com"},{"name":"octet","email":"vieuxtech@gmail.com"},{"name":"rfeng","email":"enjoyjava@gmail.com"},{"name":"ritch","email":"skawful@gmail.com"},{"name":"rmg","email":"r.m.graham@gmail.com"},{"name":"strongloop","email":"strngops@us.ibm.com"}],"dist":{"shasum":"637e4a41001bacd7388bc32feeff445c11f1d962","tarball":"https://registry.npmjs.org/strong-pubsub-bridge/-/strong-pubsub-bridge-0.2.1.tgz","integrity":"sha512-HjNPRVV4wqomNMxi55egZAdYlrk2+H6prpInp3TdMA2gBcFI/oFh377vDulEY313Aw3U5BOmuZ4UVB2mfvGaTw==","signatures":[{"sig":"MEUCIQCyf3O7fkakwHi2v8SMv31O0J4+IG2J9OMjfuwl0P98uwIgOt6ZyccL1l6+4mll/3bRuLx499od/crH2zojyOVuTE0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"637e4a41001bacd7388bc32feeff445c11f1d962","gitHead":"32ed5a7819a77405f7bbaac3724dd7483edfa456","scripts":{"test":"mocha"},"_npmUser":{"name":"rmg","email":"r.m.graham@gmail.com"},"_npmVersion":"3.8.8","description":"Create a bridge between pubsub clients and brokers","directories":{},"_nodeVersion":"4.4.3","dependencies":{"debug":"^2.1.2"},"devDependencies":{"mocha":"^2.2.1","strong-pubsub":"^0.2.0","strong-pubsub-mqtt":"^0.1.0","strong-pubsub-test":"^0.2.0","strong-pubsub-connection-mqtt":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/strong-pubsub-bridge-0.2.1.tgz_1462574278068_0.08394111949019134","host":"packages-16-east.internal.npmjs.com"}}},"time":{"created":"2015-04-27T18:33:32.388Z","modified":"2026-04-14T15:10:54.601Z","0.1.0":"2015-04-27T18:33:32.388Z","0.1.1":"2015-04-27T18:34:10.780Z","0.2.0":"2015-04-27T18:43:58.553Z","0.2.1":"2016-05-06T22:38:01.063Z"},"author":{"name":"Ritchie Martori"},"license":"MIT","description":"Create a bridge between pubsub clients and brokers","maintainers":[],"readme":"# strong-pubsub-bridge\n\n**Create a bridge between a `Client` and a broker.**\n\n## Installation\n\n```\n$ npm install strong-pubsub-bridge\n```\n\n## Use\n\nUse `Bridge` for the following:\n\n - Bridge connections to brokers\n - Inject logic inbetween client actions (publish / subscribe / etc) and brokers\n - Adapt a connection that speaks one protocol to a broker that requires another \n\n**TCP**\n\nBelow is an example accepting a **tcp** connection, upgrading it to a\n**strong-pubsub** `Connection`, and creating a bridge to an **MQTT** broker.\n\n```js\n// tcp server\ntcpServer.on('connection', function(socket) {\n  var bridge = new Bridge(\n    // upgrade the tcp socket into a strong-pubsub-connection\n    new Connection(socket),\n    new Client({port: MOSQUITTO_PORT}, Adapter)\n  );\n\n  bridge.connect();\n});\n```\n\n**Primus**\n\nHere is an example that upgrades a **primus** `Spark` into a\n**strong-pubsub** `Connection` and creating a bridge to an **MQTT** broker.\n\n```js\n// primus server\nprimus.on('connection', function(spark) {\n  var bridge = new Bridge(\n    new Connection(spark),\n    new Client({port: MOSQUITTO_PORT}, Adapter)\n  );\n\n  bridge.connect();\n});\n```\n\n**Hooks**\n\nBelow is an example using a hook to inject a function to be invoked before an\naction is performed by the bridge on behalf of a `Connection`.\n\n```js\nbridge.before(action, function(ctx, next) {\n  console.log('about to publish to');\n  console.log(ctx.topic); // => \"my topic\"\n  next();\n});\n```\n\n## API\n\n[See the API docs.](http://apidocs.strongloop.com/strong-pubsub-bridge)\n","readmeFilename":"README.md","users":{}}