Nighttime Peanut Migrations
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    sshconfpublic

    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

    32

    version

    2.0.0

    license

    MIT

    homepage

    github.com

    last publish

    collaborators

    • avatar