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'