diff --git a/lib/models.js b/lib/models.js index 06f8d88..6d6c001 100644 --- a/lib/models.js +++ b/lib/models.js @@ -1,4 +1,5 @@ var _ = require("lodash"); +var moment = require("moment"); var models = exports; var id = 0; @@ -40,9 +41,9 @@ models.User = function(attr) { models.Message = function(attr) { attr = attr || {}; _.extend(this, _.defaults(attr, { - text: "", - time: "", - user: "" + time: moment().format("HH:mm"), + user: "", + text: "" })); }; diff --git a/package.json b/package.json index 6755da5..a0b739a 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,28 @@ { + "name": "chat", + "description": "A web-based client/server IRC chat", "author": { "name": "Mattias Erming", "email": "mattias@mattiaserming.com" }, - "description": "A web-based client/server IRC chat", "dependencies": { "commander": "2.1.0", "connect": "2.13.0", "irc": "0.3.6", "lodash": "2.4.1", + "moment": "2.5.1", "socket.io": "0.9.16" + }, + "keywords": [ + "chat", + "irc", + "server", + "web", + "browser" + ], + "main": "./app.js", + "repository": { + "type": "git", + "url": "https://github.com/erming/chat.git" } }