famous-metrics
Advanced tools
Comparing version 0.0.0 to 0.0.1
16
index.js
@@ -1,2 +0,2 @@ | ||
var mixpanelId = '1ca6a3146db8e6b46af00d0ce399260e'; | ||
var mixpanelId = '1ca6a3146db8e6b46af00d0ce399260e '; | ||
var mixpanel = require('mixpanel').init(mixpanelId); | ||
@@ -14,3 +14,9 @@ var rc = require('rc'); | ||
exports.setTinfoil = function (email, cb) { | ||
// get old config value | ||
if (typeof config.noTinfoil === "boolean") { | ||
config.tinfoil = config.noTinfoil; | ||
delete config.noTinfoil; | ||
} | ||
exports.setTinfoil = function setTinfoil(email, cb) { | ||
if (email || !(email instanceof Function)) { | ||
@@ -23,10 +29,11 @@ config.unique_id = crypto.createHash('sha256').update(email).digest('base64'); | ||
} | ||
console.log(config); | ||
fs.writeFile(path.join(osenv.home(), '.famousrc'), JSON.stringify(config, undefined, 2), cb); | ||
}; | ||
exports.getTinfoil = function () { | ||
exports.getTinfoil = function getTinfoil() { | ||
return config.tinfoil; | ||
}; | ||
exports.track = function (event, data, cb) { | ||
exports.track = function track(event, data, cb) { | ||
if (data instanceof Function) { | ||
@@ -39,2 +46,3 @@ cb = data; | ||
data.distinct_id = config.unique_id; | ||
console.log(data); | ||
mixpanel.track(event, data, cb); | ||
@@ -41,0 +49,0 @@ } else { |
{ | ||
"name": "famous-metrics", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "Metrics collection for Famous Tools", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2370
43