Check if a git remote repository exists
$ npm i is-git-remote --save
or
$ yarn add is-git-remote
const isGitRemote = require('is-git-remote'); // import isGitRemote from 'is-git-remote'
isGitRemote('www.github.com/username/repo-that-exists'); // => true
isGitRemote('https://www.github.com/username/repo-that-exists'); // => true
isGitRemote('username/repo-that-exists', 'bitbucket.com'); // => true
// automatically checks github if no host is provided
isGitRemote('username/repo-that-not-exists'); // => false
MIT ยฉ Lukas Aichbauer