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"
});
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"
Now returns a promise if a callback is not supplied.
No significant changes, just minor code formatting. it's time for a 1.0 release!
bug fixes
Pass an object to [parse-git-config][] to ensure that path
is used.