@rocketmakers/shell-executor
v0.2.0
Published
This contains a default implementation of the `IShellExecutor` interface.
Downloads
127
Keywords
Readme
Overview
This contains a default implementation of the IShellExecutor interface.
Basic use
import { ShellExecutor } from '@rocketmakers/shell-executor';
const shell = new ShellExecutor();
await shell.exec(['pwd']);Providing default options
import { ShellExecutor } from '@rocketmakers/shell-executor';
// Run all commands in some-directory by default
const someDirShell = new ShellExecutor({ cwd: './some-directory' });
const someDirPath = await someDirShell.exec(['pwd']);
// Default options can be overridden
const rootPath = await someDirShell.exec(['pwd'], { cwd: '/' });