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 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/"));
// => false
Documentation
IsSsh(input)
Checks if an input value is a ssh url or not.
Params
- String
input: The input url.
Return
- Boolean
trueif the input is a ssh url,falseotherwise.
How to contribute
Have an idea? Found a bug? See how to contribute.
License
KINDLY © Ionică Bizău–The LICENSE file contains a copy of the license.