1.3.0 • Published 4 years ago

get-ssh-config v1.3.0

Weekly downloads
4,175
License
ISC
Repository
github
Last release
4 years ago

get-ssh-config

Get Hosts From Local SSH Config File

Usage

  node ./dist/index.js

Or

import { getSSHConfig } from 'get-ssh-config';

const printHosts = () => {

  console.log(getSSHConfig());

}

printHosts();

Returns an array of "hosts" derived from the config file:

[
  {
     Host: [ 'staging' ],
     HostName: 'app1.test.matrix.com',
     User: 'keanu',
     IdentityFile: '~/.ssh/id_rsa',
  },
  {
     Host: [ 'prod' ],
     HostName: 'app1.prod.matrix.com',
     User: 'keanu',
     IdentityFile: '~/.ssh/id_rsa',
  }
]

The SSH Config File

This package assumes that you have a properly formatted file named config at ~/.ssh/config on your local machine.

See ssh.com/ssh/config and cyjake ssh-config for more information about formatting and parsing the config file.

1.3.0

4 years ago

1.1.0

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago