0.1.5 • Published 11 years ago
ssh-url v0.1.5
ssh-url

Utilities to resolute and parse ssh url including scp-like syntax SSH protocol.
Installation
$ npm install ssh-url --saveUsage
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.giturl.parse(urlStr)
Takes a SSH URL string, and returns an object.
urlObj
For now, urlObj only contains four properties.
- protocol
null|Stringif null, indicates thaturlStruses scp-like syntax. - user
String - hostname
Stringfor now, there's no port. - pathname
Stringstarts with'/'
url.format(urlObj)
Takes a parsed SSH URL object, and returns a formatted URL string.