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
- Host: GitHub
- URL: https://github.com/hash-bang/ssh-parse
- Owner: hash-bang
- License: mit
- Created: 2015-12-19T03:58:12.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-19T04:39:46.000Z (over 9 years ago)
- Last Synced: 2025-02-01T17:36:18.068Z (4 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.