Skip to content

Commit

Permalink
feat(cli): simlper log output (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmichalina authored Oct 4, 2019
1 parent 7390f7a commit 78c7d8f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
},
"devDependencies": {
"@types/jest": "^24.0.18",
"@types/node": "^12.7.9",
"@types/node": "^12.7.11",
"@types/xmldom": "^0.1.29",
"jest": "^24.9.0",
"rollup": "^1.22.0",
"rollup": "^1.23.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-typescript2": "^0.24.3",
"semantic-release": "^15.13.24",
Expand Down
17 changes: 15 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,21 @@ export const devices$ = probe$.pipe(map(a => a.map(b => b.device)))
export const responses$ = probe$.pipe(map(a => a.map(b => b.raw)))

export const cli = () => {
console.log('Scanning for networked cameras...')
return devices$.subscribe(console.log)
return devices$
.subscribe(res => {
console.clear()
console.log('Camera Probe')
console.table(
res.map(device => {
return {
Name: device.name,
Model: device.hardware,
IP: device.ip,
URN: device.urn,
Endpoiint: device.deviceServiceUri
}
}))
})
}

// interface IReponse {
Expand Down

0 comments on commit 78c7d8f

Please sign in to comment.