Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pubnub-test

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pubnub-test - npm Package Compare versions

Comparing version 3.7.17 to 3.7.18

node.js/pubnub.js-e

70

node.js/examples/history.js

@@ -7,44 +7,42 @@ /* ---------------------------------------------------------------------------

--------------------------------------------------------------------------- */
var pubnub = require("./../pubnub.js");
var channel = 'my_channel';
var network = pubnub.init({
var PUBNUB = require("./../pubnub.js");
var channel = 'my_channel1';
var pubnub = PUBNUB.init({
publish_key : "demo",
subscribe_key : "demo",
cipher_key : "enigma"
});
var pubnub1 = PUBNUB.init({
publish_key : "demo",
subscribe_key : "demo"
});
/* ---------------------------------------------------------------------------
Print All
--------------------------------------------------------------------------- */
get_all_history({
channel : channel,
callback : function(messages) {
console.log(messages);
}
})
pubnub.history({
'channel' : channel,
'callback' : function(r) {
console.log(JSON.stringify(r));
},
'error' : function(r) {
/* ---------------------------------------------------------------------------
Get All History Message for a CHANNEL
--------------------------------------------------------------------------- */
function get_all_history(args) {
var channel = args['channel']
, callback = args['callback']
, start = 0
, history = [];
}
});
pubnub.history({
'include_token' : true,
'channel' : channel,
'callback' : function(r) {
console.log(JSON.stringify(r));
},
'error' : function(r) {
(function add_messages() {
network.detailedHistory({
channel : channel,
start : start,
reverse : true,
callback : function(messages) {
var msgs = messages[0]
, end = start = messages[2];
}
});
pubnub1.history({
'include_token' : true,
'channel' : channel,
'callback' : function(r) {
console.log(JSON.stringify(r));
},
'error' : function(r) {
if (!msgs.length) return callback(history);
history = history.concat(msgs);
add_messages();
}
});
})();
}
}
});
{
"name": "pubnub-test",
"preferGlobal": false,
"version": "3.7.17",
"version": "3.7.18",
"author": "PubNub <stephen@pubnub.com>",

@@ -6,0 +6,0 @@ "description": "Publish & Subscribe Real-time Messaging with PubNub",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc