1.3.0 • Published 6 years ago

@aleclarson/exec v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

@aleclarson/exec v1.3.0

Easy shell execution

const exec = require('exec');

// Sync version
try {
  const stdout = exec.sync('npm root -g');
  console.log(stdout);
} catch(stderr) {
  console.error(stderr);
}

// Async version
exec('git status --porcelain')
  .then(stdout => {
    console.log(stdout);
  }, stderr => {
    console.error(stderr);
  });

// Child process options
const files = await exec('ls -a', {
  cwd: 'path/to/dir'
});

// Additional arguments
const status = await exec('git status', [
  porcelain ? '--porcelain' : null, // null and undefined values are filtered out
]);

Available options are described here.

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago