@vyriy/exec
Part of Vyriy - a calm architecture toolkit for TypeScript, React, SSR, SSG, APIs, and cloud-ready apps.
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/exec
With Yarn:
yarn add @vyriy/exec
Usage
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.