home-path and byte-size

This commit is contained in:
Lloyd Brookes
2014-06-07 22:21:51 +01:00
parent 7e9b67df57
commit 51a998204a
2 changed files with 7 additions and 3 deletions

View File

@ -10,7 +10,9 @@ var dope = require("console-dope"),
morgan = require("morgan"),
serveStatic = require("serve-static"),
directory = require("serve-index"),
compress = require("compression");
compress = require("compression"),
homePath = require("home-path"),
byteSize = require("byte-size");
var usage =
"usage: \n\
@ -30,7 +32,7 @@ function halt(message){
- {cwd}/package.json
*/
var storedConfig = loadConfig(
path.join(w.getHomeDir(), ".local-web-server.json"),
path.join(homePath(), ".local-web-server.json"),
path.join(process.cwd(), ".local-web-server.json"),
path.join(process.cwd(), "package.json:local-web-server")
);
@ -127,7 +129,7 @@ if (argv.config){
}
oldWrite.call(this, data);
total.bytes += data.length;
dope.column(12).write(w.padRight(w.bytesToSize(total.bytes, 2), 12));
dope.column(12).write(w.padRight(byteSize(total.bytes, 2), 12));
};
dope.column(24).write(++total.connections);
socket.on("close", function(){