dist/exec.js
function exec(cmd, args, options) {
    // If true user wants stdout to output value
    // instead of using inherit outputting
    // to process.stdout stream.
    if (options === true)
        options = { stdio: 'pipe' };
    options = chek_1.extend({}, spawnDefaults, options);
    if (chek_1.isString(args))
        args = argv_1.splitArgs(args);
    // Ensure command and arguments.
    if (!cmd)
        logger_1.log.error('Cannot execute process with command of undefined.');
    args = args.map(function (s) {
        if (/\s/g.test(s))
            return '"' + s + '"';
        return s;
    });
    // Spawn child.
    var child = child_process_1.spawnSync(cmd, args, options);
    if (child.stdout)
        return child.stdout.toString();
}
function exec(cmd, args, options) {
    // If true user wants stdout to output value
    // instead of using inherit outputting
    // to process.stdout stream.
    if (options === true)
        options = { stdio: 'pipe' };
    options = chek_1.extend({}, spawnDefaults, options);
    if (chek_1.isString(args))
        args = argv_1.splitArgs(args);
    // Ensure command and arguments.
    if (!cmd)
        logger_1.log.error('Cannot execute process with command of undefined.');
    args = args.map(function (s) {
        if (/\s/g.test(s))
            return '"' + s + '"';
        return s;
    });
    // Spawn child.
    var child = child_process_1.spawnSync(cmd, args, options);
    if (child.stdout)
        return child.stdout.toString();
}
function exec ( cmd , args , options ) { // If true user wants stdout to output value // instead of using inherit outputting // to process.stdout stream. if ( options === true ) options = { stdio : 'pipe' } ; options = chek_1 . extend ( { } , spawnDefaults , options ) ; if ( chek_1 . isString ( args ) ) args = argv_1 . splitArgs ( args ) ; // Ensure command and arguments. if ( ! cmd ) logger_1 . log . error ( 'Cannot execute process with command of undefined.' ) ; args = args . map ( function ( s ) { if ( / \s / g . test ( s ) ) return '"' + s + '"' ; return s ; } ) ; // Spawn child. var child = child_process_1 . spawnSync ( cmd , args , options ) ; if ( child . stdout ) return child . stdout . toString ( ) ; }
Exec
Executes command using child process.

@param cmd node, npm or shell command to be executed.
@param args arguments to be passed to command.
@param options the child process spawn options.
Exec Executes command using child process .