src/library/options.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 0

Size

Lines of Code 19
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
cc 2
c 2
b 1
f 1
nc 4
dl 0
loc 19
rs 10
wmc 2
mnd 1
bc 0
fnc 0
bpm 0
cpm 0
noi 0
1
import nopt from 'nopt'
2
import path from 'path'
3
4
const opts = {
5
  outputDir: path,
6
  port: Number,
7
  clean: Boolean,
8
}
9
const shortOpts = {
10
  o: ['--outputDir'],
11
  p: ['--port'],
12
  c: ['--clean'],
13
}
14
const output = nopt(opts, shortOpts, process.argv, 2)
15
16
output.outputDir = (output.outputDir === undefined) ? './output' : output.outputDir
17
output.port = (output.port === undefined) ? '9001' : output.port
18
19
export default output