Comparing version 0.0.2 to 0.0.3
// Generated by CoffeeScript 1.9.3 | ||
(function() { | ||
console.log("Hey"); | ||
var CRC32, Debug, Depurar, appRoot, debug, path, util; | ||
path = require("path"); | ||
util = require("util"); | ||
CRC32 = require("crc-32"); | ||
debug = require("debug")("Depurar:" + path.basename(__filename, path.extname(__filename))); | ||
appRoot = require("app-root-path"); | ||
Debug = require("debug"); | ||
Depurar = (function() { | ||
function Depurar(namespace) { | ||
var basename, color, dbg, filepath, parentDir, stackError; | ||
if (("" + namespace).indexOf(":") === -1) { | ||
stackError = new Error; | ||
filepath = Depurar._getCallerPathFromTrace(stackError); | ||
basename = path.basename(filepath, path.extname(filepath)); | ||
parentDir = path.basename(appRoot); | ||
if (namespace) { | ||
namespace = namespace + ":" + basename; | ||
} else { | ||
namespace = parentDir + ":" + basename; | ||
} | ||
} | ||
color = Depurar._getColorFromNamespace(namespace); | ||
dbg = Debug(namespace); | ||
dbg.color = color; | ||
return dbg; | ||
} | ||
Depurar._getColorFromNamespace = function(namespace, colors) { | ||
var absCrc, color, colorIndex, first, last, ref; | ||
if (colors == null) { | ||
colors = [6, 2, 3, 4, 5, 1]; | ||
} | ||
ref = namespace.split(":"), first = ref[0], last = ref[ref.length - 1]; | ||
absCrc = Math.abs(CRC32.str(last)); | ||
colorIndex = absCrc % colors.length; | ||
color = colors[colorIndex]; | ||
return color; | ||
}; | ||
Depurar._getCallerPathFromTrace = function(stackError) { | ||
var caller, filepath, matches; | ||
caller = stackError.stack.split('\n')[2].trim(); | ||
matches = caller.match(/\(([^\:]+)\:/); | ||
filepath = matches[1]; | ||
return filepath; | ||
}; | ||
return Depurar; | ||
})(); | ||
module.exports = Depurar; | ||
}).call(this); | ||
//# sourceMappingURL=Depurar.js.map |
{ | ||
"name": "depurar", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Debug with added sugar", | ||
@@ -13,5 +13,9 @@ "keywords": [ | ||
"dependencies": { | ||
"debug": "^1.0.4" | ||
"app-root-path": "^1.0.0", | ||
"crc-32": "^0.3.0", | ||
"debug": "2.2.0" | ||
}, | ||
"devDependencies": { | ||
"airbud": "^3.3.1", | ||
"async": "^1.2.1", | ||
"chai": "^3.0.0", | ||
@@ -21,3 +25,5 @@ "coffee-script": "^1.9.3", | ||
"mocha": "^2.2.5", | ||
"should": "^7.0.1" | ||
"npm-check-updates": "^1.5.1", | ||
"should": "^7.0.1", | ||
"underscore": "^1.8.3" | ||
}, | ||
@@ -24,0 +30,0 @@ "repository": { |
@@ -1,2 +0,5 @@ | ||
# node-depurar | ||
Debug with added sugar | ||
# depurar | ||
> **depurar** (first-person singular present indicative depuro, past participle depurado) | ||
> 1. to purify, cleanse | ||
> 2 (computing) To debug |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
15825
165
6
3
9
+ Addedapp-root-path@^1.0.0
+ Addedcrc-32@^0.3.0
+ Addedapp-root-path@1.4.0(transitive)
+ Addedcrc-32@0.3.0(transitive)
+ Addeddebug@2.2.0(transitive)
+ Addedms@0.7.1(transitive)
- Removeddebug@1.0.5(transitive)
- Removedms@2.0.0(transitive)
Updateddebug@2.2.0