servez 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/servez CHANGED
@@ -39,6 +39,7 @@ program
39
39
  .usage('[options] [path-to-serve]')
40
40
  .argument('[path-to-serve]', 'path to serve')
41
41
  .option('-p, --port <port>', 'port', fixedParseInt, 8080)
42
+ .option('-q, --quiet', 'do not show requests and missing file messages')
42
43
  .option('--no-scan', 'do not scan for open port')
43
44
  .option('--qr', 'print QR Code for root url')
44
45
  .option('--no-dirs', 'do not show directory listing')
@@ -129,7 +130,9 @@ function main(pathToServe, args) {
129
130
  log.info('');
130
131
  }
131
132
  }
132
- log.info('press CTRL-C to stop the server.');
133
+ if (args.verbose === undefined || args.verbose >= 1) {
134
+ log.info('press CTRL-C to stop the server.');
135
+ }
133
136
  },
134
137
  };
135
138
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "servez",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "A simple command line server to replace http-server",
5
5
  "scripts": {
6
6
  "start": "node ./bin/servez"
@@ -26,7 +26,7 @@
26
26
  "ansi-colors": "^4.1.1",
27
27
  "color-support": "^1.1.3",
28
28
  "commander": "^11.0.0",
29
- "servez-lib": "^2.6.0"
29
+ "servez-lib": "^2.8.0"
30
30
  },
31
31
  "bin": {
32
32
  "servez": "./bin/servez"
@@ -17,10 +17,20 @@ function sendCmd(cmd, data) {
17
17
  });
18
18
  }
19
19
 
20
+ console.log(JSON.stringify(args, null, 2));
21
+
20
22
  c.enabled = useColors;
21
23
  const logger = {
22
24
  log: (...args) => sendCmd('log', args),
23
25
  error: (...args) => sendCmd('error', args),
26
+ filter: (msgType) => {
27
+ switch (msgType) {
28
+ case Servez.MsgType.Info:
29
+ return args.quiet ? false : true;
30
+ default:
31
+ return true;
32
+ }
33
+ },
24
34
  c,
25
35
  };
26
36