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

nats-repl

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

nats-repl - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

lib/match.js

29

lib/main.js

@@ -67,2 +67,3 @@ 'use strict';

nats.close();
process.exit(0);
});

@@ -98,2 +99,3 @@ rl.on('line', function (line) {

});
nats.once('disconnect', done);
}, function () {

@@ -148,4 +150,28 @@ nats.unsubscribe(sid);

var nats = _nats2.default.connect(_commander2.default.server);
function ping() {
if (!nats || !nats.pongs) return;
nats.sendCommand('PING\r\n');
nats.pongs.push(null);
}
setInterval(function () {
if (nats && nats.pongs && nats.pongs.length > 5) return nats.stream.end();
ping();
}, 1000);
function attachDisconnectHandler() {
nats.once('disconnect', function () {
rl.pause();
rl.clearLine(process.stdout, 0);
_util2.default.warn("Disconnected from server, attempting reconnect...");
nats.once('reconnect', function () {
rl.resume();
rl.prompt();
attachDisconnectHandler();
});
});
}
nats.on('close', function () {
process.exit(0);
_util2.default.error("Connection was closed");
rl.close();
});

@@ -159,2 +185,3 @@ nats.on('error', function (e) {

_util2.default.info("Connected to server " + nats.url.href);
attachDisconnectHandler();
rl.setPrompt('> ');

@@ -161,0 +188,0 @@ rl.prompt();

2

package.json
{
"name": "nats-repl",
"version": "1.0.0",
"version": "1.1.0",
"description": "A simple REPL client for NATS",

@@ -5,0 +5,0 @@ "main": "lib/main.js",

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