{"_id":"pubnubjs","_rev":"40-f0e3d8d83eb2904fc13cba52ca087433","name":"pubnubjs","time":{"modified":"2022-06-24T23:46:46.740Z","created":"2014-10-15T12:59:16.632Z","0.0.1":"2014-10-15T12:59:16.632Z","0.0.2":"2014-10-15T17:25:53.882Z","0.0.3":"2014-10-15T21:56:26.850Z","0.0.4":"2014-10-15T21:59:10.590Z","0.0.5":"2014-10-15T22:54:03.201Z","0.0.6":"2014-10-16T03:08:36.528Z","0.0.7":"2014-10-16T04:15:04.642Z","0.0.8":"2014-10-16T14:40:26.291Z","0.0.9":"2014-10-16T14:55:48.487Z","0.0.10":"2014-10-19T18:55:07.951Z","0.0.11":"2014-10-20T01:26:45.300Z","0.0.12":"2014-10-24T12:39:11.748Z","0.0.13":"2014-10-29T17:39:21.096Z"},"maintainers":[{"name":"tralamazza","email":"tralamazza@gmail.com"}],"dist-tags":{"latest":"0.0.13"},"description":"PubNub pipelined client","readme":"# PubNub JS client [![Build Status](https://travis-ci.org/tralamazza/pubnubjs.svg?branch=master)](https://travis-ci.org/tralamazza/pubnubjs) [![NPM version](https://badge.fury.io/js/pubnubjs.svg)](http://badge.fury.io/js/pubnubjs) [![Dependency Status](https://gemnasium.com/tralamazza/pubnubjs.svg)](https://gemnasium.com/tralamazza/pubnubjs)\n\n\tnpm install pubnubjs\n\n## Characteristics\n\n* Implemented using PubNub's HTTP pipelining API\n* Authentication and Encryption keys are supplied per request\n* Supports gzip compression for `subscribe`\n* SSL by default\n\n## Usage\n\nPublishes every 100ms:\n\n```js\nvar PubNubJS = require('pubnubjs');\n\nvar client = PubNubJS({\n\t// port: 443,\n\t// host: 'pubsub.pubnub.com',\n\t// insecure: false,\n\t// pool_max: 50,\n\t// pool_idletimeout: 20000,\n\t// secret_key: '', /* required for .grant() */\n\tsubscribe_key: 'sub-c- ...', /* required */\n\tpublish_key: 'pub-c- ...' /* required */\n});\nsetInterval(function() {\n\tclient.publish('my_little_channel', { ts: Date.now() }, {\n\t\t// cipher_key: 'my encryption key',\n\t\t// params: { auth: 'my auth key' }\n\t}, function(err, data) {\n\t\tconsole.log('publish', err, data);\n\t});\n}, 100);\n```\n\nSubscribes for 10s:\n\n```js\nclient.subscribe('my_little_channel', {\n\t// timetoken: '0',\n\t// cipher_key: 'my encryption key',\n\t// gzip: false,\n\t// params: { auth: 'my auth key' }\n}, function(err, stream, unsubscribe) {\n\tsetTimeout(unsubscribe, 10000);\n\tstream.on('data', console.log);\n});\n```\n\nGrant read & write access to a channel:\n\n```js\nclient.grant({\n\t// ttl: 1440,\n\tw: 1, r: 1,\n\tchannel: 'my_little_channel_with_auth',\n\tauth: '12345'\n}, function(err, data) {\n\tconsole.log('grant', err, data);\n});\n```\n\n## Important\n\n* We keep a socket pool with a default idle timeout of 20s, see `options.pool_idletimeout`\n* You should only publish objects or JSON strings.\n* `.subscribe()` returns an object stream.\n\n## MIT Licensed\n\n\tThe MIT License (MIT)\n\n\tCopyright (c) 2014 Daniel Tralamazza <tralamazza@relayr.de>\n\n\tPermission is hereby granted, free of charge, to any person obtaining a copy\n\tof this software and associated documentation files (the \"Software\"), to deal\n\tin the Software without restriction, including without limitation the rights\n\tto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n\tcopies of the Software, and to permit persons to whom the Software is\n\tfurnished to do so, subject to the following conditions:\n\n\tThe above copyright notice and this permission notice shall be included in\n\tall copies or substantial portions of the Software.\n\n\tTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\tIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\tFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\tAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\tLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n\tOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n\tTHE SOFTWARE.\n","versions":{"0.0.8":{"name":"pubnubjs","version":"0.0.8","description":"PubNub client","main":"index.js","scripts":{"test":"tape test/*.js"},"author":{"name":"Daniel Tralamazza","email":"tralamazza@relayr.de"},"license":"MIT","dependencies":{"generic-pool":"^2.1.1","jsonparse":"0.0.6"},"devDependencies":{"rc":"^0.5.1","tape":"^3.0.0","uuid":"^2.0.1"},"gitHead":"903d9099ee61139a4ec361b29c49dbf8c400acba","_id":"pubnubjs@0.0.8","_shasum":"8e469ac432d22dde41ddbb381f4eba1548e7f8ce","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"tralamazza","email":"tralamazza@gmail.com"},"maintainers":[{"name":"tralamazza","email":"tralamazza@gmail.com"}],"dist":{"shasum":"8e469ac432d22dde41ddbb381f4eba1548e7f8ce","tarball":"https://registry.npmjs.org/pubnubjs/-/pubnubjs-0.0.8.tgz","integrity":"sha512-SGeWVFisiZJV4D0pykWMnQSfV/sqRYMAt5IgmvTZ0tyR90BJt7e9F2J5vGgUmW0xe60QeXDIYpyEVIIBR/tTXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICroNqPWZm1u6RpdoMrxqR3TkLwcfgzhWDLDrMhOOzAAAiBBUx/25/lprffg3L5D5oEvdIk+Qg6rNWueh9iRvaALZQ=="}]}},"0.0.9":{"name":"pubnubjs","version":"0.0.9","description":"PubNub pipelined client","main":"index.js","scripts":{"test":"tape test/*.js"},"author":{"name":"Daniel Tralamazza","email":"tralamazza@relayr.de"},"license":"MIT","dependencies":{"generic-pool":"^2.1.1","jsonparse":"0.0.6"},"devDependencies":{"rc":"^0.5.1","tape":"^3.0.0","uuid":"^2.0.1"},"homepage":"https://github.com/tralamazza/pubnubjs","bugs":{"url":"https://github.com/tralamazza/pubnubjs/issues"},"repository":{"type":"git","url":"https://github.com/tralamazza/pubnubjs.git"},"keywords":["pubnub"],"gitHead":"09dfd9587073708f4812df0df934336ac232405d","_id":"pubnubjs@0.0.9","_shasum":"ea42b570fc1b011c1acc16f11c24f3cc9bb748fd","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"tralamazza","email":"tralamazza@gmail.com"},"maintainers":[{"name":"tralamazza","email":"tralamazza@gmail.com"}],"dist":{"shasum":"ea42b570fc1b011c1acc16f11c24f3cc9bb748fd","tarball":"https://registry.npmjs.org/pubnubjs/-/pubnubjs-0.0.9.tgz","integrity":"sha512-/hVZOiDuED4SlQGDHNAOP+LyFhSGIuQbswwwSLtIEDGPFsYLTBtItkDoNxLOO15NfSjMEOHYDVKf6VFt7cI0WQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC9My/EOyjYd6zVVSVN5l30K3/8RhA16npcCWQg9tuL+AiEA/u5M52sQElNviB6xt7PCoKdqj872SFTgmG0buXFat9c="}]}},"0.0.10":{"name":"pubnubjs","version":"0.0.10","description":"PubNub pipelined client","main":"index.js","scripts":{"test":"tape test/*.js"},"author":{"name":"Daniel Tralamazza","email":"tralamazza@relayr.de"},"license":"MIT","dependencies":{"generic-pool":"^2.1.1","jsonparse":"0.0.6"},"devDependencies":{"rc":"^0.5.1","tape":"^3.0.0","uuid":"^2.0.1"},"homepage":"https://github.com/tralamazza/pubnubjs","bugs":{"url":"https://github.com/tralamazza/pubnubjs/issues"},"repository":{"type":"git","url":"https://github.com/tralamazza/pubnubjs.git"},"keywords":["pubnub"],"gitHead":"7be4946bc95d01f004e76d59b1342df8230449fb","_id":"pubnubjs@0.0.10","_shasum":"faa926b1c6e8bccb3fff043ab738efca18aa3943","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"tralamazza","email":"tralamazza@gmail.com"},"maintainers":[{"name":"tralamazza","email":"tralamazza@gmail.com"}],"dist":{"shasum":"faa926b1c6e8bccb3fff043ab738efca18aa3943","tarball":"https://registry.npmjs.org/pubnubjs/-/pubnubjs-0.0.10.tgz","integrity":"sha512-TLxjiButyfGxeq73uj1pIE3K88SgbwzXCqrRuouQMH559/+aMs6+yB0ko3gPiuj1T1BGXNKdTc2GMuW7QJ3i6w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF4M+zCUWV3d0yQQmLmHlHRrdMPPbzCp3k7FgG3fSkpCAiBcwaMEHLGaj306w/b9d8WfgU5vuNsd9EeXzmRf+FO0Ew=="}]}},"0.0.11":{"name":"pubnubjs","version":"0.0.11","description":"PubNub pipelined client","main":"index.js","scripts":{"test":"tape test/*.js"},"author":{"name":"Daniel Tralamazza","email":"tralamazza@relayr.de"},"license":"MIT","dependencies":{"generic-pool":"^2.1.1","jsonparse":"0.0.6"},"devDependencies":{"rc":"^0.5.1","tape":"^3.0.0","uuid":"^2.0.1"},"homepage":"https://github.com/tralamazza/pubnubjs","bugs":{"url":"https://github.com/tralamazza/pubnubjs/issues"},"repository":{"type":"git","url":"https://github.com/tralamazza/pubnubjs.git"},"keywords":["pubnub"],"gitHead":"2e47be27e0c034a1d45be9ee09d8044dbb2fa8f7","_id":"pubnubjs@0.0.11","_shasum":"a36bf5dd7f2dff99c5de4acdf49287da5a642aa2","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"tralamazza","email":"tralamazza@gmail.com"},"maintainers":[{"name":"tralamazza","email":"tralamazza@gmail.com"}],"dist":{"shasum":"a36bf5dd7f2dff99c5de4acdf49287da5a642aa2","tarball":"https://registry.npmjs.org/pubnubjs/-/pubnubjs-0.0.11.tgz","integrity":"sha512-UAfucslNf2ke5E2wZ8cXkooI50XT93l2YULVbvIk0qMUmkgdkMmFZhle03YK99nwdVeS4Dv3vLXbSyIT0Nu+qQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkcTWSouqm15w3Py4lk8HXr5DfRv4il0UDfAcgGvEergIhAOrg2BlzxtSm23hYV6Idhkk9GDQUz9W/z0xVuQwGj7y9"}]}},"0.0.12":{"name":"pubnubjs","version":"0.0.12","description":"PubNub pipelined client","main":"index.js","scripts":{"test":"tape test/*.js"},"author":{"name":"Daniel Tralamazza","email":"tralamazza@relayr.de"},"license":"MIT","dependencies":{"generic-pool":"^2.1.1","jsonparse":"0.0.6"},"devDependencies":{"rc":"^0.5.1","tape":"^3.0.0","uuid":"^2.0.1"},"homepage":"https://github.com/tralamazza/pubnubjs","bugs":{"url":"https://github.com/tralamazza/pubnubjs/issues"},"repository":{"type":"git","url":"https://github.com/tralamazza/pubnubjs.git"},"keywords":["pubnub"],"gitHead":"72bb80ef775276ad1cfcbf81df8c3269d741f798","_id":"pubnubjs@0.0.12","_shasum":"7861e94443709a98e5e9ddf1131b81e3c5b31efa","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"tralamazza","email":"tralamazza@gmail.com"},"maintainers":[{"name":"tralamazza","email":"tralamazza@gmail.com"}],"dist":{"shasum":"7861e94443709a98e5e9ddf1131b81e3c5b31efa","tarball":"https://registry.npmjs.org/pubnubjs/-/pubnubjs-0.0.12.tgz","integrity":"sha512-+aPhuOC6tSSoik3CgxJaX+yEhsZ4MEj3c/Xxjl4XCMHHCW89DF811uVlfl1otBNUtIRQLUH2PUMhZ6BISNxXig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxfPU5DgG+7pQtTE0SYOqi33hy4U+/xEUd0j+Kl2GTCgIgKSulGTaQQFmi5FLPYZvT+1X4sT55/amneMT4Xr1CYyM="}]}},"0.0.13":{"name":"pubnubjs","version":"0.0.13","description":"PubNub pipelined client","main":"index.js","scripts":{"test":"tape test/*.js"},"author":{"name":"Daniel Tralamazza","email":"tralamazza@relayr.de"},"license":"MIT","dependencies":{"generic-pool":"^2.1.1","jsonparse":"0.0.6","xtend":"^4.0.0"},"devDependencies":{"rc":"^0.5.1","tape":"^3.0.0","uuid":"^2.0.1"},"homepage":"https://github.com/tralamazza/pubnubjs","bugs":{"url":"https://github.com/tralamazza/pubnubjs/issues"},"repository":{"type":"git","url":"https://github.com/tralamazza/pubnubjs.git"},"keywords":["pubnub"],"gitHead":"ea3f7ef7938c77ae74b23d6284753c56379a4a80","_id":"pubnubjs@0.0.13","_shasum":"fd4494b364a619af39327789901a40e60d865429","_from":".","_npmVersion":"2.1.6","_nodeVersion":"0.10.33","_npmUser":{"name":"tralamazza","email":"tralamazza@gmail.com"},"maintainers":[{"name":"tralamazza","email":"tralamazza@gmail.com"}],"dist":{"shasum":"fd4494b364a619af39327789901a40e60d865429","tarball":"https://registry.npmjs.org/pubnubjs/-/pubnubjs-0.0.13.tgz","integrity":"sha512-4BlKZl43F/t7pfE8JUPqR2zBbCXcmjVWFILXuQ6pNGNfBWtV0Y9O7fQaW1lV7DCQ80KoevAnzSxnFTYPBqfqkQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBMJwPoS3PPjNJ18/txKNLfQ0G72AxRjrwDs9nujjsbVAiEA6EQypfSqjf0vi72zeu5Q/Eeq5FCzdUsUKxHpvdWaqss="}]}}},"author":{"name":"Daniel Tralamazza","email":"tralamazza@relayr.de"},"license":"MIT","readmeFilename":"README.md","homepage":"https://github.com/tralamazza/pubnubjs","keywords":["pubnub"],"repository":{"type":"git","url":"https://github.com/tralamazza/pubnubjs.git"},"bugs":{"url":"https://github.com/tralamazza/pubnubjs/issues"}}