npm

Need private packages and team management tools?Check out npm Orgs. »

sshconf

2.0.0 • Public • Published

sshconf

sshconf is a robust, streaming ssh config parser.

Build status

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))
  }))

License

MIT

install

npm i sshconf

Downloadsweekly downloads

12

version

2.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability