1.0.5 • Published 12 months ago
@arbz/execute v1.0.5
@arbz/execute
A promisified wrapper for Node.js's child_process.exec for easier and more readable async execution of shell commands.
Installation
Install the package using npm or yarn:
npm install @arbz/execute
# or
yarn add @arbz/executeUsage
Import the execute function and run shell commands with a promise-based API:
import { execute } from '@arbz/execute';
const run = async () => {
const gitLog = await execute('git log', {
disableStdOut: true, // Suppress standard output
});
console.log(gitLog); // Handle the command output
};
run();Options
The execute function accepts a second parameter for configuration:
| Option | Type | Default | Description |
|---|---|---|---|
disableStdOut | boolean | false | If true, suppresses stdout output. |
Features
- Promise-based API for cleaner asynchronous code.
- Suppress
stdouteasily using thedisableStdOutoption.
License
This project is licensed under the MIT License.