is-ssh ![Support this project](http://i.imgur.com/6cMbHOC.png)
Check if an input value is a ssh url or not.
Installation
$ npm i is-ssh
Example
var IsSsh = require("is-ssh");
console.log(IsSsh("ssh://user@host.xz:port/path/to/repo.git/"));
console.log(IsSsh("ssh://user@host.xz/path/to/repo.git/"));
console.log(IsSsh("ssh://host.xz:port/path/to/repo.git/"));
console.log(IsSsh("ssh://host.xz/path/to/repo.git/"));
console.log(IsSsh("ssh://user@host.xz/path/to/repo.git/"));
console.log(IsSsh("ssh://host.xz/path/to/repo.git/"));
console.log(IsSsh("ssh://user@host.xz/~user/path/to/repo.git/"));
console.log(IsSsh("ssh://host.xz/~user/path/to/repo.git/"));
console.log(IsSsh("ssh://user@host.xz/~/path/to/repo.git"));
console.log(IsSsh("ssh://host.xz/~/path/to/repo.git"));
console.log(IsSsh("user@host.xz:/path/to/repo.git/"));
console.log(IsSsh("user@host.xz:~user/path/to/repo.git/"));
console.log(IsSsh("user@host.xz:path/to/repo.git"));
console.log(IsSsh("host.xz:/path/to/repo.git/"));
console.log(IsSsh("host.xz:path/to/repo.git"));
console.log(IsSsh("host.xz:~user/path/to/repo.git/"));
console.log(IsSsh("rsync://host.xz/path/to/repo.git/"));
console.log(IsSsh("git://host.xz/path/to/repo.git/"));
console.log(IsSsh("git://host.xz/~user/path/to/repo.git/"));
console.log(IsSsh("http://host.xz/path/to/repo.git/"));
console.log(IsSsh("https://host.xz/path/to/repo.git/"));
console.log(IsSsh("/path/to/repo.git/"));
console.log(IsSsh("path/to/repo.git/"));
console.log(IsSsh("~/path/to/repo.git"));
console.log(IsSsh("file:///path/to/repo.git/"));
console.log(IsSsh("file://~/path/to/repo.git/"));
Documentation
IsSsh(input)
Checks if an input value is a ssh url or not.
Params
- String|Array
input
: The input url or an array of protocols.
Return
- Boolean
true
if the input is a ssh url, false
otherwise.
How to contribute
Have an idea? Found a bug? See how to contribute.
Where is this library used?
If you are using this library in one of your projects, add it in this list. :sparkles:
License
KINDLY © Ionică Bizău