mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
Merge pull request #6185 from frankebersoll/master
Node.js: Added child_process.spawnSync
This commit is contained in:
@@ -13,6 +13,7 @@ import * as dgram from "dgram";
|
||||
import * as querystring from "querystring";
|
||||
import * as path from "path";
|
||||
import * as readline from "readline";
|
||||
import * as childProcess from "child_process";
|
||||
|
||||
assert(1 + 1 - 2 === 0, "The universe isn't how it should.");
|
||||
|
||||
@@ -401,3 +402,10 @@ rl.prompt(true);
|
||||
rl.question("do you like typescript?", function(answer: string) {
|
||||
rl.close();
|
||||
});
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
/// Child Process tests: https://nodejs.org/api/child_process.html ///
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
childProcess.exec("echo test");
|
||||
childProcess.spawnSync("echo test");
|
||||
|
||||
20
node/node.d.ts
vendored
20
node/node.d.ts
vendored
@@ -868,6 +868,26 @@ declare module "child_process" {
|
||||
env?: any;
|
||||
encoding?: string;
|
||||
}): ChildProcess;
|
||||
export function spawnSync(command: string, args?: string[], options?: {
|
||||
cwd?: string;
|
||||
input?: string | Buffer;
|
||||
stdio?: any;
|
||||
env?: any;
|
||||
uid?: number;
|
||||
gid?: number;
|
||||
timeout?: number;
|
||||
maxBuffer?: number;
|
||||
killSignal?: string;
|
||||
encoding?: string;
|
||||
}): {
|
||||
pid: number;
|
||||
output: string[];
|
||||
stdout: string | Buffer;
|
||||
stderr: string | Buffer;
|
||||
status: number;
|
||||
signal: string;
|
||||
error: Error;
|
||||
};
|
||||
export function execSync(command: string, options?: {
|
||||
cwd?: string;
|
||||
input?: string|Buffer;
|
||||
|
||||
Reference in New Issue
Block a user