Helpers

execAsync.mjs

@mr_ozio/scraper-utils · v2.5.0 · Generated April 21, 2026

Target Style

Target Style

2 exports

const

runCommand

Target Style
export const runCommand = async (command, { in: cwd, ...options } = {}) => {

Runs a shell command with an optional working directory.

Target style API. Preferred for new code.

Parameters

  • commandstring
  • [options]import('child_process').ExecOptions

Returns

Promise<{ stdout: string, stderr: string }>

Example

const { stdout } = await runCommand('pwd', {
  in: '/tmp',
})

const

readCommandOutput

Target Style
export const readCommandOutput = async (command, options = {}) => {

Runs a shell command and returns only stdout.

Target style API. Preferred for new code.

Parameters

  • commandstring
  • [options]import('child_process').ExecOptions

Returns

Promise<string>

Legacy Style

Legacy Style

1 exports

const

execAsync

Legacy Style
export const execAsync = execCommand

Promisified child_process.exec.

Legacy API. Kept for older code and not the preferred choice for new code.