system-commands
Version:
Run system commands in Node.js
13 lines (12 loc) • 531 B
TypeScript
declare module 'system-commands' {
/**
* Runs a system command
*
* @param command The command you want to run, like `ls` or `mkdir new_directory`
* @param maxBuffer The maximum amount of bytes you want to allocate to this operation. If you specify a value, you are unable to get an output.
*
* @returns A `Promise` containing the output of the command. If the command failed, the error is passed into the `.catch` block.
*/
function system(command: string, maxBuffer?: number): Promise<string>
export = system
}