Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 465 Bytes

.verb.md

File metadata and controls

31 lines (22 loc) · 465 Bytes

Usage

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

Optionally pass the cwd (current working directory) as the first argument.

Promise

branch('some/path')
  .then(name => console.log('Branch:', name)) //=> 'master'
  .catch(console.error);

Callback

branch(function(err, name) {
  if (err) throw err;
  console.log('Branch:', name); //=> 'master'
});

Sync

console.log('Branch:', branch.sync()); //=> 'master'