generated from napi-rs/package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexec.d.ts
29 lines (28 loc) · 1.28 KB
/
exec.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
export type ExecvpOptions = {
readonly arg0?: string | null;
};
/**
* Performs the execvp system call with the given file and arguments, replacing
* the current process image with the new one.
*
* This function does not return if successful, as the current process image is
* replaced by the new one. An error may be thrown, with an error message
* containing the error code returned by execvp.
*
* @example
* import { execvp } from '@alphahydrae/exec';
* execvp('ls', ['-l', '.']);
*
* @param {string} file The file to execute. If not a path, the PATH environment
* variable is searched.
* @param {string[]} args The arguments to pass to the new process. The `file`
* argument is automatically prepended to the arguments
* and passed as the first argument to the `execvp`
* system call.
* @param {Object} [options] Optional options.
* @param {string} [options.arg0=file] The value to pass as the first argument
* to the `execvp` system call. Defaults to
* the `file` argument.
* @throws {Error} If the execvp system call fails.
*/
export declare function execvp(file: string, args: string[], options?: ExecvpOptions): void;