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

beepboop

Package Overview
Dependencies
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beepboop - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

6

lib/beepboop.js
'use strict'
var Resourcer = require(__dirname + '/resourcer.js')
var Resourcer = require('./resourcer.js')
module.exports = {
start: function (options) {
var resourcer = Resourcer(options)
resourcer.connect()
return resourcer
return Resourcer(options).connect()
}
}
// Keeping it simple. The default logger only logs (at any level)
// if debug is true. In error cases, where you might assume we should alwasy log
// if debug is true. In error cases, where you might assume we should always log
// the errors are emitted so the consuming code has an opportunity to handle.

@@ -5,0 +5,0 @@ module.exports = function Logger (debug) {

@@ -6,3 +6,3 @@ 'use strict'

var deap = require('deap')
var retry = require('./retry.js')
var Retry = require('./retry')

@@ -15,2 +15,3 @@ module.exports = function Resourcer (config) {

var resourcer = new EventEmitter2({wildcard: true})
var retry = Retry()

@@ -24,2 +25,4 @@ resourcer.connect = function (inWs) {

.on('error', handledError)
return resourcer
}

@@ -42,7 +45,5 @@

if (ws) {
ws
.removeAllListeners(handledOpen)
.removeAllListeners(handledError)
.removeAllListeners(handledClose)
.removeAllListeners(handledMessage)
ws.removeAllListeners()
// this is a noop if already closed
ws.close()
}

@@ -58,2 +59,3 @@

log.error('Invalid BEEPBOOP_RESOURCER environment variable value:', config.serverURL, e.toString())
// Exit process, this only occurs if the serverURL isn't a valid url
process.exit(1)

@@ -74,3 +76,3 @@ }

if (err) {
ws.emit('error', err)
handledError(err)
log.error('Authorization to the Beep Boop Server failed with:', err.toString())

@@ -82,2 +84,4 @@ }

log.debug('Web Socket connection opened to Beep Boop Server:', config.serverURL)
// Reset retry backoff
retry = Retry()
}

@@ -95,3 +99,3 @@

retry.attempt(resourcer.connect)
retry(resourcer.connect)
}

@@ -102,3 +106,4 @@

log.debug('Connection to Beep Boop server closed.', code, message)
retry.attempt(resourcer.connect)
retry(resourcer.connect)
}

@@ -105,0 +110,0 @@

@@ -8,9 +8,14 @@ var Back = require('back')

var backAttempt
var back
function attempt (cb) {
var back = backAttempt || (backAttempt = new Back(options))
return back.backoff(cb)
module.exports = function () {
if (back) {
back.close()
}
back = new Back(options)
return function retry (cb) {
back.backoff(cb)
}
}
module.exports.attempt = attempt
{
"name": "beepboop",
"version": "0.0.9",
"version": "0.0.10",
"description": "beepboop eases hosting a botkit based bot on the beepboop hosting platform.",
"main": "lib/beepboop.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "mocha test"
},

@@ -32,3 +32,7 @@ "homepage": "http://beepboophq.com",

"ws": "^1.0.1"
},
"devDependencies": {
"mocha": "^2.4.5",
"sinon": "^1.17.3"
}
}

@@ -6,3 +6,2 @@ var events = require('events')

var Resourcer = require(__dirname + '/../lib/resourcer.js')
var retry = require(__dirname + '/../lib/retry.js')

@@ -9,0 +8,0 @@ describe('Resourcer', function () {

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