@vyriy/exec
v0.3.5
Published
Command execution utility for Vyriy projects
Readme
@vyriy/exec
Command execution utility for Vyriy projects.
Purpose
This package provides a small promise-based wrapper around node:child_process.exec for running shell commands and returning stdout as a string.
Install
With npm:
npm install @vyriy/execWith Yarn:
yarn add @vyriy/execUsage
import { exec } from '@vyriy/exec';
const stdout = await exec(`"${process.execPath}" -e "process.stdout.write('ok')"`);
console.log(stdout);Exports
The package exposes both the root entry and the direct utility module:
import { exec } from '@vyriy/exec';
import { exec as runCommand } from '@vyriy/exec/exec';API
exec(cmd, options?, showLogs?)runscmdthroughnode:child_process.exec.optionsis forwarded to the underlying Nodeexeccall, withmaxBufferforced toInfinity.showLogsdefaults totrueand writes the command lifecycle plusstdoutandstderrthrough@vyriy/logger.- the returned promise resolves to
stdoutas a string.
