1.0.5 • Published 11 months ago

@arbz/execute v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@arbz/execute

npm version npm downloads

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/execute

Usage

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:

OptionTypeDefaultDescription
disableStdOutbooleanfalseIf true, suppresses stdout output.

Features

  • Promise-based API for cleaner asynchronous code.
  • Suppress stdout easily using the disableStdOut option.

License

This project is licensed under the MIT License.