sshconf-upsert
Upsert hosts into your ~/.ssh/config
file(s).
Installation
$ npm install sshconf-upsert
Usage
require('sshconf-upsert')(contents, hosts, callback)
var upsert =fs =var config = fs
Essentially, sshconf-upsert
takes a config string and an array of hosts,
returning an updated version. Existing entries will be modified, and missing
ones added to the end. The above script should take this:
Host firstHostName 192.168.2.1# comments and formatting# are preservedHost secondHostName 192.168.2.4
And turn it into this:
Host firstHostName 192.168.2.1# comments and formatting# are preservedHost secondHostName google.comHost thirdHostName 192.168.2.16