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

https://github.com/hash-bang/ssh-parse

Parse a SSH/SCP/Rsync style address in a URL.parse compatible way
https://github.com/hash-bang/ssh-parse

Last synced: 4 months ago
JSON representation

Parse a SSH/SCP/Rsync style address in a URL.parse compatible way

Awesome Lists containing this project

README

        

ssh-parse
=========
Parse a SSH/SCP/Rsync style address in a `URL.parse()` compatible way.

var sshParse = require('ssh-parse');

var parsed = sshParse('someone@somewhere:~/some/path');
console.log(parsed);

// Returns:

Url {
protocol: 'ssh:',
slashes: true,
auth: 'someone',
host: 'somewhere',
port: 22,
hostname: 'somewhere',
hash: null,
search: null,
query: null,
pathname: '~/some/path',
path: '~/some/path',
href: 'ssh://someone@somewhere/~/some/path' }
}

See the [test file](test/test.js) for more specific examples.