execa
Version:
Process execution for humans
22 lines (16 loc) • 625 B
TypeScript
/**
Split a `command` string into an array. For example, `'npm run build'` returns `['npm', 'run', 'build']` and `'argument otherArgument'` returns `['argument', 'otherArgument']`.
@param command - The file to execute and/or its arguments.
@returns fileOrArgument[]
@example
```
import {execa, parseCommandString} from 'execa';
const commandString = 'npm run task';
const commandArray = parseCommandString(commandString);
await execa`${commandArray}`;
const [file, ...commandArguments] = commandArray;
await execa(file, commandArguments);
```
*/
export function parseCommandString(command: string): string[];
export {};