index.js
function (cmd, cwd, callback) {
    var async = typeof callback === 'function';

    var result = exec(
        cmd,
        {cwd: cwd},
        async ? callback : undefined
    );

    return result.code !== 0 && !async ? result.stdout : undefined;
}
function (cmd, cwd, callback) {
    var async = typeof callback === 'function';

    var result = exec(
        cmd,
        {cwd: cwd},
        async ? callback : undefined
    );

    return result.code !== 0 && !async ? result.stdout : undefined;
}
function ( cmd , cwd , callback ) { var async = typeof callback === 'function' ; var result = exec ( cmd , { cwd : cwd } , async ? callback : undefined ) ; return result . code !== 0 && ! async ? result . stdout : undefined ; }
Executes a terminal command
@param  {String}   cmd      Command to execute
@param  {String}   cwd      Current working directory
@param  {Function} callback Callback only if the command is async
@return {String|undefined}
Executes a terminal command