Package Exports
- is-ssh
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-ssh) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
is-ssh 
Check if an input value is a ssh url or not.
Installation
$ npm i --save is-sshExample
// Dependencies
var IsSsh = require("is-ssh");
// Secure Shell Transport Protocol (SSH)
console.log(IsSsh("ssh://user@host.xz:port/path/to/repo.git/"));
// => true
console.log(IsSsh("ssh://user@host.xz/path/to/repo.git/"));
// => true
console.log(IsSsh("ssh://host.xz:port/path/to/repo.git/"));
// => true
console.log(IsSsh("ssh://host.xz/path/to/repo.git/"));
// => true
console.log(IsSsh("ssh://user@host.xz/path/to/repo.git/"));
// => true
console.log(IsSsh("ssh://host.xz/path/to/repo.git/"));
// => true
console.log(IsSsh("ssh://user@host.xz/~user/path/to/repo.git/"));
// => true
console.log(IsSsh("ssh://host.xz/~user/path/to/repo.git/"));
// => true
console.log(IsSsh("ssh://user@host.xz/~/path/to/repo.git"));
// => true
console.log(IsSsh("ssh://host.xz/~/path/to/repo.git"));
// => true
console.log(IsSsh("user@host.xz:/path/to/repo.git/"));
// => true
console.log(IsSsh("user@host.xz:~user/path/to/repo.git/"));
// => true
console.log(IsSsh("user@host.xz:path/to/repo.git"));
// => true
console.log(IsSsh("host.xz:/path/to/repo.git/"));
// => true
console.log(IsSsh("host.xz:path/to/repo.git"));
// => true
console.log(IsSsh("host.xz:~user/path/to/repo.git/"));
// => true
console.log(IsSsh("rsync://host.xz/path/to/repo.git/"));
// => true
// Git Transport Protocol
console.log(IsSsh("git://host.xz/path/to/repo.git/"));
// => false
console.log(IsSsh("git://host.xz/~user/path/to/repo.git/"));
// => false
// HTTP/S Transport Protocol
console.log(IsSsh("http://host.xz/path/to/repo.git/"));
// => false
console.log(IsSsh("https://host.xz/path/to/repo.git/"));
// => false
// Local (Filesystem) Transport Protocol
console.log(IsSsh("/path/to/repo.git/"));
// => false
console.log(IsSsh("path/to/repo.git/"));
// => false
console.log(IsSsh("~/path/to/repo.git"));
// => false
console.log(IsSsh("file:///path/to/repo.git/"));
// => false
console.log(IsSsh("file://~/path/to/repo.git/"));
// => falseDocumentation
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
trueif the input is a ssh url,falseotherwise.
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. ✨