New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nats-hemera

Package Overview
Dependencies
Maintainers
1
Versions
279
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nats-hemera - npm Package Compare versions

Comparing version

to
3.2.0

46

lib/index.js

@@ -533,3 +533,3 @@ /**

if (this._isReady) {
throw new Errors.HemeraError('Hemera is already bootstraped')
throw new Errors.HemeraError('Hemera was already bootstraped')
}

@@ -571,20 +571,38 @@

const bootstrapCb = (err, cb) => {
if (err) {
this.log.error(err)
const ready = cb => {
if (this._transport.driver.connected) {
this.log.info(Constants.NATS_TRANSPORT_CONNECTED)
this.bootstrap(cb)
} else {
this._transport.driver.on('connect', () => {
this.log.info(Constants.NATS_TRANSPORT_CONNECTED)
this.bootstrap(cb)
})
}
if (_.isFunction(cb)) {
cb(err)
}
}
if (this._transport.driver.connected) {
this.log.info(Constants.NATS_TRANSPORT_CONNECTED)
this.bootstrap(err => bootstrapCb(err, cb))
} else {
this._transport.driver.on('connect', () => {
this.log.info(Constants.NATS_TRANSPORT_CONNECTED)
this.bootstrap(err => bootstrapCb(err, cb))
// callback style
if (_.isFunction(cb)) {
ready(err => {
if (err) {
this.log.error(err)
cb(err)
return
}
cb()
})
return
}
// promise style
return new Promise((resolve, reject) => {
ready(err => {
if (err) {
this.log.error(err)
reject(err)
return
}
resolve()
})
})
}

@@ -591,0 +609,0 @@

{
"name": "nats-hemera",
"author": "Dustin Deus (https://github.com/StarpTech)",
"version": "3.1.9",
"version": "3.2.0",
"main": "lib/index.js",

@@ -6,0 +6,0 @@ "homepage": "https://hemerajs.github.io/hemera/",