1.8.0 • Published 2 years ago

@cush/exec v1.8.0

Weekly downloads
46
License
MIT
Repository
github
Last release
2 years ago

@cush/exec

Easy shell execution

const exec = require('@cush/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.

Notes

  • An error is thrown (or the promise is rejected) whenever the exit code of the child process is non-zero.
1.8.0

2 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.6.4

3 years ago

1.6.3

3 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.2

5 years ago

1.3.1

6 years ago