Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

exec-sync-uc

for using nodejs native sync-exec as array command with log

sync-exec, exec

readme

npm version Build Status

exec-sync-uc

Usage 1

// native execSync
const nativeExecSync = require('child_process').execSync;
nativeExecSync('cat *.js ' + bad_file + ' | wc -l');

// is equivalent to
const execSync = require('exec-sync-uc');
const PIPE = '|';
execSync([ 'cat *.js', bad_file, PIPE, 'wc -l' ]);

Usage 2

const NPM = '/home/ubuntu/.nvm/versions/node/v4.2.6/bin/npm';
const DIR_NAME = 'SOME_DIR_PATH';
const zip_file = process.argv[2];

execSync(['rm', '-rf', DIR_NAME ]);

execSync('unzip'+ zip_file +' -d'+ DIR_NAME );
// It's hard to find problem by `whitespace`, let's use below

execSync(['unzip', zip_file, '-d', DIR_NAME ]);
execSync([ NPM, 'install', '--production'], { cwd: DIR_NAME });