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

analytics-node

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

analytics-node - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

26

lib/client.js

@@ -26,7 +26,8 @@ var _ = require('underscore'),

this.initialized = false;
this.lastFlush = null;
this.queue = [];
// No-op on error so we don't kill the server.
this.on('error', function () {});
if (options) this.init(options);

@@ -95,3 +96,3 @@ };

* @return {events.EventEmitter} Promise event emitter that emits 'flush' once
* the message has been flushed, and 'err' when an error has occured.
* the message has been flushed, and 'error' when an error has occured.
*

@@ -156,3 +157,3 @@ */

* @return {events.EventEmitter} Promise event emitter that emits 'flush' once
* the message has been flushed, and 'err' when an error has occured.
* the message has been flushed, and 'error' when an error has occured.
*

@@ -210,3 +211,3 @@ */

/**
* Whenever a user triggers an event, you’ll want to track it.
* Aliases an anonymous user into an identified user.
*

@@ -219,3 +220,3 @@ * @param {Object} options

* @return {events.EventEmitter} Promise event emitter that emits 'flush' once
* the message has been flushed, and 'err' when an error has occured.
* the message has been flushed, and 'error' when an error has occured.
*

@@ -252,2 +253,3 @@ */

var promise = new events.EventEmitter();
promise.on('error', function(){});

@@ -291,3 +293,3 @@ var message = {

// to conserve memory
this.emit('err',
this.emit('error',
new Error('analytics-node client failed to enqueue message ' +

@@ -392,3 +394,3 @@ 'because queue is full. Consider increasing queue ' +

if (err)
self.emit('err', err);
self.emit('error', err);
else

@@ -398,4 +400,8 @@ self.emit('flush');

_.each(promises, function (promise) {
if (err) promise.emit('err', err);
else promise.emit('flush');
if (err) {
// Check for listeners so there is no uncaught exception.
if (promise.listeners('error').length > 0) promise.emit('error', err);
} else {
promise.emit('flush');
}
});

@@ -402,0 +408,0 @@

{
"name": "analytics-node",
"version": "0.4.0",
"version": "0.5.0",
"description": "The hassle-free way to integrate analytics into any node application.",

@@ -5,0 +5,0 @@ "repository": "git://github.com/segmentio/analytics-node",

@@ -251,3 +251,3 @@

client.on('err', function (err) {
client.on('error', function (err) {

@@ -254,0 +254,0 @@ should.exist(err);

@@ -10,3 +10,3 @@

promise.once('err', function (err) {
promise.once('error', function (err) {
should.not.exist(err);

@@ -13,0 +13,0 @@ done(err);

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