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

mixpanel

Package Overview
Dependencies
Maintainers
3
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mixpanel - npm Package Compare versions

Comparing version 0.4.1 to 0.5.0

4

history.md

@@ -0,1 +1,5 @@

0.5.0 / 2016-09-15
===================
* optional https support (thanks chiangf)
0.4.1 / 2016-09-09

@@ -2,0 +6,0 @@ ===================

27

lib/mixpanel-node.js

@@ -10,7 +10,13 @@ /*

var http = require('http'),
querystring = require('querystring'),
Buffer = require('buffer').Buffer,
util = require('util');
var http = require('http'),
https = require('https'),
querystring = require('querystring'),
Buffer = require('buffer').Buffer,
util = require('util');
var REQUEST_LIBS = {
http: http,
https: https
};
var create_client = function(token, config) {

@@ -28,3 +34,4 @@ var metrics = {};

verbose: false,
host: 'api.mixpanel.com'
host: 'api.mixpanel.com',
protocol: 'http'
};

@@ -52,2 +59,10 @@

var request_lib = REQUEST_LIBS[metrics.config.protocol];
if (!request_lib) {
throw new Error(
"Mixpanel Initialization Error: Unsupported protocol " + metrics.config.protocol + ". " +
"Supported protocols are: " + Object.keys(REQUEST_LIBS)
);
}
if (endpoint === '/import') {

@@ -73,3 +88,3 @@ var key = metrics.config.key;

http.get(request_options, function(res) {
request_lib.get(request_options, function(res) {
var data = "";

@@ -76,0 +91,0 @@ res.on('data', function(chunk) {

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

],
"version": "0.4.1",
"version": "0.5.0",
"homepage": "https://github.com/mixpanel/mixpanel-node",

@@ -13,0 +13,0 @@ "author": "Carl Sverre",

@@ -23,2 +23,7 @@ Mixpanel-node

// initialize mixpanel client configured to communicate over https
var mixpanel = Mixpanel.init('6fd9434dba686db2d1ab66b4462a3a67', {
protocol: 'https'
});
// track an event with optional properties

@@ -190,2 +195,3 @@ mixpanel.track('my event', {

- [Jim Thomas](https://github.com/Left47)
- [Frank Chiang](https://github.com/chiangf)

@@ -192,0 +198,0 @@ License

@@ -10,5 +10,9 @@ var Mixpanel = require('../lib/mixpanel-node');

"is set to correct defaults": function(test) {
test.deepEqual(this.mixpanel.config,
{ test: false, debug: false, verbose: false, host: 'api.mixpanel.com' },
"default config is incorrect");
test.deepEqual(this.mixpanel.config, {
test: false,
debug: false,
verbose: false,
host: 'api.mixpanel.com',
protocol: 'http'
}, "default config is incorrect");
test.done();

@@ -15,0 +19,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