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

bananas

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bananas - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

15

lib/index.js

@@ -29,6 +29,8 @@ 'use strict';

let updates = [];
const flush = function () {
const flush = function (callback) {
callback = callback || Hoek.ignore;
if (!updates.length) {
return;
return callback();
}

@@ -40,3 +42,3 @@

const payload = holder.map(JSON.stringify).join('\n');
Wreck.post(uri, { payload, headers: { 'content-type': 'application/json' }, json: true }, Hoek.ignore); // No point in loggin errors
Wreck.post(uri, { payload, headers: { 'content-type': 'application/json' }, json: true }, callback);
};

@@ -89,3 +91,8 @@

return next();
// Log initialization
const init = internals.update('server');
init.tags = ['bananas', 'initialized'];
updates.push(init);
return flush(next);
};

@@ -92,0 +99,0 @@

{
"name": "bananas",
"description": "Minimal Loggly hapi plugin",
"version": "1.1.0",
"version": "1.2.0",
"author": "Eran Hammer <eran@hammer.io> (http://hueniverse.com)",

@@ -6,0 +6,0 @@ "repository": "git://github.com/hueniverse/bananas",

@@ -37,2 +37,10 @@ 'use strict';

let updates = [];
const orig = Wreck.post;
Wreck.post = function (uri, options, next) {
updates = updates.concat(options.payload.split('\n'));
return next();
};
server.register({ register: Bananas, options: settings }, (err) => {

@@ -52,9 +60,2 @@

const updates = [];
const orig = Wreck.post;
Wreck.post = function (uri, options, ignore) {
updates.push({ uri, options });
};
server.start((err) => {

@@ -68,4 +69,3 @@

const messages = updates[0].options.payload.split('\n');
expect(messages.length).to.equal(3);
expect(updates.length).to.equal(4);
Wreck.post = orig;

@@ -78,3 +78,3 @@

});
}, 110);
}, 200);
});

@@ -95,2 +95,10 @@ });

let updates = [];
const orig = Wreck.post;
Wreck.post = function (uri, options, next) {
updates = updates.concat(options.payload.split('\n'));
return next();
};
server.register({ register: Bananas, options: settings }, (err) => {

@@ -109,9 +117,2 @@

const updates = [];
const orig = Wreck.post;
Wreck.post = function (uri, options, ignore) {
updates.push({ uri, options });
};
server.start((err) => {

@@ -125,3 +126,3 @@

expect(updates.length).to.equal(1);
expect(updates.length).to.equal(2);
Wreck.post = orig;

@@ -134,3 +135,3 @@

});
}, 110);
}, 200);
});

@@ -137,0 +138,0 @@ });

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