Socket
Socket
Sign inDemoInstall

analytics-node

Package Overview
Dependencies
121
Maintainers
3
Versions
48
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.2 to 2.0.0

8

History.md
2.0.0 / 2015-09-21
==================
* update analytics-node.js
* Remove proxy support
* Merge pull request #47 from yorkie/patch-1
* remove the duplicated keyword
1.2.2 / 2015-03-19

@@ -3,0 +11,0 @@ ==================

11

lib/index.js

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

var request = require('superagent');
require('superagent-proxy')(request);
require('superagent-retry')(request);

@@ -32,3 +31,2 @@ var type = require('component-type');

* @property {String} host (default: 'https://api.segment.io')
* @property {String|Object} proxy (default: null)
*/

@@ -45,3 +43,2 @@

this.flushAfter = options.flushAfter || 10000;
this.proxy = options.proxy || null;
}

@@ -152,9 +149,3 @@

var req = request
.post(this.host + '/v1/batch');
if (this.proxy) {
req = req.proxy(this.proxy);
}
req
.post(this.host + '/v1/batch')
.auth(this.writeKey, '')

@@ -161,0 +152,0 @@ .retry(3)

{
"name": "analytics-node",
"repository": "git://github.com/segmentio/analytics-node",
"version": "1.2.2",
"version": "2.0.0",
"description": "The hassle-free way to integrate analytics into any node application.",

@@ -11,4 +11,3 @@ "keywords": [

"client",
"driver",
"analytics"
"driver"
],

@@ -36,3 +35,3 @@ "main": "lib/index.js",

"express": "~3.4.8",
"http-proxy": "~1.3.0",
"http-proxy": "~1.11.1",
"mocha": "1.8.1",

@@ -48,2 +47,2 @@ "brfs": "^1.3.0"

"license": "MIT"
}
}
var assert = require('assert');
var Analytics = require('..');
var async = require('async');
var Browser = require('../analytics-node');
var server = require('./server');

@@ -18,12 +17,5 @@

before(function(done){
async.series([
function(cb){
server.proxy.listen(server.ports.proxy, cb);
},
function(cb){
server.app
.post('/v1/batch', server.fixture)
.listen(server.ports.source, cb);
}
], done);
server.app
.post('/v1/batch', server.fixture)
.listen(server.ports.source, done);
});

@@ -67,4 +59,3 @@

flushAt: 1,
flushAfter: 2,
proxy: 'http://localhost:9001'
flushAfter: 2
});

@@ -74,3 +65,2 @@ assert.equal(a.host, 'a');

assert.equal(a.flushAfter, 2);
assert.equal(a.proxy, 'http://localhost:9001');
});

@@ -157,17 +147,2 @@

it('should proxy', function(done) {
a = Analytics('key', {
host: 'http://localhost:4063',
flushAt: Infinity,
flushAfter: Infinity,
proxy: 'http://localhost:4064'
});
a.enqueue('type', { event: 'test' }, noop);
a.flush(function(err, data){
// our proxy turns all responses into 408/errs
assert(err);
done();
});
});
it('should callback with an HTTP error', function(done){

@@ -330,8 +305,2 @@ enqueue(a, ['error']);

});
describe('browserify', function(){
it('should expose a browserified bundle', function(){
assert('function' == typeof Browser);
});
});
});

@@ -338,0 +307,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc