Utilities to resolute and parse ssh url including scp-like syntax SSH protocol.
npm install ssh-urlUtilities to resolute and parse ssh url including scp-like syntax SSH protocol.
``bash`
$ npm install ssh-url --save
`js
var url = require('ssh-url');
var parsed = url.parse('git@github.com:kaelzhang/node-ssh-url.git');
// -> {
// protocol: null,
// user: 'git',
// hostname: 'github.com',
// pathname: '/kaelzhang/node-ssh-url.git'
// }
url.format(parsed);
// -> git@github.com:kaelzhang/node-ssh-url.git
`
Takes a SSH URL string, and returns an object.
#### urlObj
For now, urlObj only contains four properties.
- protocol null|String if null, indicates that urlStr uses scp-like syntax.String
- user String
- hostname for now, there's no port.String
- pathname starts with '/'`
Takes a parsed SSH URL object, and returns a formatted URL string.