Skip to content

Latest commit

 

History

History
70 lines (47 loc) · 1.14 KB

.verb.md

File metadata and controls

70 lines (47 loc) · 1.14 KB

Usage

const origin = require('{%= name %}');

async/await

(async() => {
  let url = await origin();
  console.log(url);
  // url => "https://github.com/jonschlinkert/remote-origin-url.git"
})();

Callback

origin((err, url) => {
  if (err) return console.log(err);
  console.log(url);
  // url => "https://github.com/jonschlinkert/remote-origin-url.git"
});

cwd

Specify the current working directory to use:

origin(process.cwd(), (err, url) => {
  if (err) return console.log(err);
  console.log(url);
  // url => "https://github.com/jonschlinkert/remote-origin-url.git"
});

sync

console.log(origin.sync());
//=> "https://github.com/jonschlinkert/remote-origin-url.git"

Specify the cwd to use:

console.log(origin.sync(process.cwd()));
//=> "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.