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

@silenteer/natsu

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@silenteer/natsu - npm Package Compare versions

Comparing version 1.0.27 to 1.0.28

42

dist/nats-client.js

@@ -13,18 +13,6 @@ "use strict";

return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
const { urls, handlers = {}, user, pass, verbose } = params;
if (Object.keys(handlers).length === 0) {
const { natsService, handlers = {} } = params;
if (!natsService || Object.keys(handlers).length === 0) {
throw new Error(`Must register handlers before starting client`);
}
const client = yield (0, nats_1.connect)({
servers: urls,
user,
pass,
pingInterval: 30 * 1000,
maxPingOut: 10,
verbose,
reconnect: true,
maxReconnectAttempts: 3,
reconnectTimeWait: 1000,
});
const natsService = createNatsService(client);
Object.entries(handlers).forEach(([subject, { handler, injection: registeredInjection, middlewares }]) => {

@@ -132,3 +120,2 @@ const subcription = natsService.subscribe(subject);

});
return natsService;
});

@@ -465,11 +452,10 @@ }

let natsService;
let isStarted;
const client = {
start: () => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
natsService = yield start({
urls,
yield start({
natsService,
handlers: natsHandlers,
user,
pass,
verbose,
});
isStarted = true;
}),

@@ -480,5 +466,19 @@ stop: () => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {

natsHandlers = undefined;
isStarted = false;
}),
register: (handlers) => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
const isStarted = !!natsService;
if (!natsService) {
const natsConnection = yield (0, nats_1.connect)({
servers: urls,
user,
pass,
pingInterval: 30 * 1000,
maxPingOut: 10,
verbose,
reconnect: true,
maxReconnectAttempts: 3,
reconnectTimeWait: 1000,
});
natsService = createNatsService(natsConnection);
}
if (isStarted) {

@@ -485,0 +485,0 @@ throw new Error(`Can't register more handler after nats client started`);

{
"name": "@silenteer/natsu",
"version": "1.0.27",
"version": "1.0.28",
"license": "MIT",

@@ -5,0 +5,0 @@ "private": false,

Sorry, the diff of this file is not supported yet

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