sshconf-stream

0.1.2 • Public • Published

sshconf-stream Build Status

Magic-free streaming SSH config parser/stringifier.

Given this ~/.ssh/config file:

Host raspberry
  HostName 192.168.2.54
  User pi

You can get this output:

var ssh = require('sshconf-stream')
  , fs = require('fs')
 
fs.createReadStream('/home/hughsk/.ssh/config', 'utf8')
  .pipe(ssh.createParseStream())
  .on('data', function(host) {
    console.log(host.keywords['Host'])         // ['raspberry']
    console.log(host.keywords['HostName'])     // ['192.168.2.54']
    console.log(host.keywords['User'])         // ['pi']
    console.log(host.keywords['LocalForward']) // undefined
  })

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    6
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    6
  • 0.1.0
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i sshconf-stream

Weekly Downloads

6

Version

0.1.2

License

MIT

Last publish

Collaborators

  • hughsk