sshconf
v2.0.0
Published
a robust, streaming ssh config parser
Downloads
16
Readme
sshconf
sshconf is a robust, streaming ssh config parser.
Install
$ npm install sshconf
Usage
var fs = require('fs')
var parse = require('sshconf/parse')
var through = require('through2')
fs.createReadStream('/path/to/ssh_config')
.pipe(parse())
.pipe(stringify())
.pipe(process.stdout)
function stringify () {
return through.obj(function (json, enc, next) {
next(null, JSON.stringify(json) + '\n')
})
}
Get parsed data as a single object
var fs = require('fs')
var parse = require('sshconf/parse')
var merge = require('sshconf/merge')
fs.createReadStream('/path/to/ssh_config')
.pipe(parse())
.pipe(merge(function (err, parsed) {
console.log(JSON.stringify(parsed, null, 2))
}))