Extract the git remote origin URL from your local git repository.
Installations
npm install remote-origin-url
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=8
Node Version
11.1.0
NPM Version
6.4.1
Score
99.6
Supply Chain
100
Quality
77.7
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
42,691,975
Last Day
20,669
Last Week
173,651
Last Month
702,532
Last Year
8,630,160
GitHub Statistics
MIT License
16 Stars
40 Commits
5 Forks
4 Watchers
1 Branches
2 Contributors
Updated on Dec 04, 2023
Bundle Size
4.93 kB
Minified
2.07 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.0.0
Package Id
remote-origin-url@2.0.0
Size
3.31 kB
NPM Version
6.4.1
Node Version
11.1.0
Published on
Nov 22, 2018
Total Downloads
Cumulative downloads
Total Downloads
42,691,975
Last Day
-27.3%
20,669
Compared to previous day
Last Week
21.1%
173,651
Compared to previous week
Last Month
3.3%
702,532
Compared to previous month
Last Year
25.3%
8,630,160
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
4
remote-origin-url

Get the git remote origin URL from your local git repository. Remember! A remote origin must exist first!
Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your :heart: and support.
Install
Install with npm:
1$ npm install --save remote-origin-url
Usage
1const origin = require('remote-origin-url');
async/await
1(async() => { 2 let url = await origin(); 3 console.log(url); 4 // url => "https://github.com/jonschlinkert/remote-origin-url.git" 5})();
Callback
1origin((err, url) => { 2 if (err) return console.log(err); 3 console.log(url); 4 // url => "https://github.com/jonschlinkert/remote-origin-url.git" 5});
cwd
Specify the current working directory to use:
1origin(process.cwd(), (err, url) => { 2 if (err) return console.log(err); 3 console.log(url); 4 // url => "https://github.com/jonschlinkert/remote-origin-url.git" 5});
sync
1console.log(origin.sync()); 2//=> "https://github.com/jonschlinkert/remote-origin-url.git"
Specify the cwd
to use:
1console.log(origin.sync(process.cwd())); 2//=> "https://github.com/jonschlinkert/remote-origin-url.git"
Release history
v2.0.0
Now returns a promise if a callback is not supplied.
v1.0.0
No significant changes, just minor code formatting. it's time for a 1.0 release!
v0.5.3
bug fixes
Pass an object to parse-git-config to ensure that path
is used.
About
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running Tests
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
1$ npm install && npm test
Building docs
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
1$ npm install -g verbose/verb#dev verb-generate-readme && verb
Related projects
You might also be interested in these projects:
- git-config-path: Resolve the path to the user's local or global .gitconfig. | homepage
- git-user-name: Get a user's name from git config at the project or global scope, depending on… more | homepage
- git-username: Get the username (or 'owner' name) from a git/GitHub remote origin URL. | homepage
- is-git-url: Regex to validate that a URL is a git url. | homepage
- parse-github-url: Parse a github URL into an object. | homepage
Contributors
Commits | Contributor |
---|---|
34 | jonschlinkert |
3 | doowb |
Author
Jon Schlinkert
License
Copyright © 2018, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.8.0, on November 22, 2018.

No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 1/29 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 2 are checked with a SAST tool
Score
3
/10
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More