Get the remote origin url of a Git repository
$ npm install git-remote-origin-url
const gitRemoteOriginUrl = require('git-remote-origin-url');
(async() => {
console.log(await gitRemoteOriginUrl());
//=> '[email protected]:sindresorhus/git-remote-origin-url.git'
})();
Type: string
Default: process.cwd()
The current working directory.
Type: string
Default: 'origin'
The Git remote name.
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.