Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hughsk/sshconf-stream

Magic-free streaming SSH config parser/stringifier.
https://github.com/hughsk/sshconf-stream

Last synced: 12 days ago
JSON representation

Magic-free streaming SSH config parser/stringifier.

Awesome Lists containing this project

README

        

# sshconf-stream [![Build Status](https://travis-ci.org/hughsk/sshconf-stream.png?branch=master)](https://travis-ci.org/hughsk/sshconf-stream)

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:

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