Browse Source

home-path and byte-size

master
Lloyd Brookes 10 years ago
parent
commit
51a998204a
  1. 8
      bin/ws.js
  2. 2
      package.json

8
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(){

2
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",

Loading…
Cancel
Save