diff --git a/bin/ws.js b/bin/ws.js index 83a5a46..8ab091a 100755 --- a/bin/ws.js +++ b/bin/ws.js @@ -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(){ diff --git a/package.json b/package.json index bab3f5e..c68c50a 100644 --- a/package.json +++ b/package.json @@ -14,11 +14,13 @@ "repository": "https://github.com/75lb/local-web-server", "author": "Lloyd Brookes", "dependencies": { + "byte-size": "^0.1.0", "command-line-args": "^0.2.0", "compression": "^1.0.2", "config-master": "~0.1.0", "connect": "^3.0.0", "console-dope": "^0.3.0", + "home-path": "^0.1.1", "morgan": "^1.0.0", "serve-index": "^1.0.2", "serve-static": "^1.1.0",