Comparing version 0.0.1 to 0.1.0
@@ -1,3 +0,26 @@ | ||
var inspect = require('util').inspect; | ||
var inspect = require('./inspect'); | ||
var format = require('./format'); | ||
function pad(n) { | ||
return n < 10 ? '0' + n.toString(10) : n.toString(10); | ||
} | ||
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', | ||
'Oct', 'Nov', 'Dec']; | ||
// 26 Feb 16:19:34 | ||
function timestamp() { | ||
var d = new Date(); | ||
var time = [pad(d.getHours()), | ||
pad(d.getMinutes()), | ||
pad(d.getSeconds())].join(':'); | ||
return [d.getDate(), months[d.getMonth()], time].join(' '); | ||
} | ||
module.exports = function() { | ||
console.log('%s - %s', timestamp(), format.apply(exports, arguments)); | ||
}; | ||
/* | ||
module.exports = function(msg, type, depth) { | ||
@@ -8,1 +31,2 @@ if (isNaN(depth)) depth = 10; | ||
} | ||
*/ |
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://github.com/snowyu/util-ex.js", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"author": { | ||
@@ -8,0 +8,0 @@ "name": "Riceball LEE", |
@@ -1,3 +0,26 @@ | ||
var inspect = require('util').inspect; | ||
var inspect = require('./inspect'); | ||
var format = require('./format'); | ||
function pad(n) { | ||
return n < 10 ? '0' + n.toString(10) : n.toString(10); | ||
} | ||
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', | ||
'Oct', 'Nov', 'Dec']; | ||
// 26 Feb 16:19:34 | ||
function timestamp() { | ||
var d = new Date(); | ||
var time = [pad(d.getHours()), | ||
pad(d.getMinutes()), | ||
pad(d.getSeconds())].join(':'); | ||
return [d.getDate(), months[d.getMonth()], time].join(' '); | ||
} | ||
module.exports = function() { | ||
console.log('%s - %s', timestamp(), format.apply(exports, arguments)); | ||
}; | ||
/* | ||
module.exports = function(msg, type, depth) { | ||
@@ -8,1 +31,2 @@ if (isNaN(depth)) depth = 10; | ||
} | ||
*/ |
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
59421
64
1320