Skip to content

Commit d318ff3

Browse files
committed
deps: remove dependency on moment
Signed-off-by: Ryan Graham <[email protected]>
1 parent f58fa7c commit d318ff3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/logger.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ var fs = require('fs');
1212
var byline = require('byline');
1313
var through = require('through');
1414
var duplexer = require('duplexer');
15-
var moment = require('moment');
1615

1716
module.exports = Logger;
1817

@@ -102,7 +101,7 @@ function textFormatter(options) {
102101
var line = util.format('%s%s', textifyTags(logEvent.tag),
103102
logEvent.msg.toString());
104103
if (options.timeStamp) {
105-
line = util.format('%s %s', moment(logEvent.time).toISOString(), line);
104+
line = util.format('%s %s', new Date(logEvent.time).toISOString(), line);
106105
}
107106
this.emit('data', line.replace(/\n/g, '\\n'));
108107
}
@@ -125,7 +124,7 @@ function jsonFormatter(options) {
125124

126125
function jsonify(logEvent) {
127126
if (options.timeStamp) {
128-
logEvent.time = moment(logEvent.time).toISOString();
127+
logEvent.time = new Date(logEvent.time).toISOString();
129128
} else {
130129
delete logEvent.time;
131130
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"byline": "^5.0.0",
3131
"duplexer": "^0.1.1",
3232
"minimist": "^1.2.0",
33-
"moment": "^2.6.0",
3433
"through": "^2.3.4"
3534
},
3635
"devDependencies": {

0 commit comments

Comments
 (0)