Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fs.readFile(process.env.HOME + '/.ssh/config', function (err, data) {
if (err) {
throw err;
}
sshConfig = sshConfig.parse(data.toString());
var output = {
Profiles: [],
};
for (var i = 0, len = sshConfig.length; i < len; i++) {
var section = sshConfig[i];
var host = section.Host;
var comment = null;
var commentIndex = section.Host.indexOf('#');
if (commentIndex !== -1) {
host = section.Host.substr(0, commentIndex);
comment = section.Host.substr(commentIndex + 1).trim();
}
var host = host.trim();
// Skip Wildcard Entries
if (host.indexOf('*') != -1) continue;