Resolves the remote url of the local git repository in the current folder.
npm install resolve-git-remote
var remote = require('resolve-git-remote');
remote(function (err, remote) {
// err will be set if no remote was found
console.log(remote); // => 'thlorenz/resolve-git-remote'
});
Code lifted from travisify.