socket-function 1.2.34 → 1.2.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1510,6 +1510,7 @@ declare module "socket-function/src/runPromise" {
1510
1510
  quiet?: boolean;
1511
1511
  nothrow?: boolean;
1512
1512
  detach?: boolean;
1513
+ includeStderrInOutput?: boolean;
1513
1514
  }): Promise<string>;
1514
1515
 
1515
1516
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socket-function",
3
- "version": "1.2.34",
3
+ "version": "1.2.35",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -4,4 +4,5 @@ export declare function runPromise(command: string, config?: {
4
4
  quiet?: boolean;
5
5
  nothrow?: boolean;
6
6
  detach?: boolean;
7
+ includeStderrInOutput?: boolean;
7
8
  }): Promise<string>;
package/src/runPromise.ts CHANGED
@@ -9,6 +9,7 @@ export async function runPromise(command: string, config?: {
9
9
  // Never throw, just return the full output
10
10
  nothrow?: boolean;
11
11
  detach?: boolean;
12
+ includeStderrInOutput?: boolean;
12
13
  }) {
13
14
  return new Promise<string>((resolve, reject) => {
14
15
  if (!config?.quiet) {
@@ -38,7 +39,9 @@ export async function runPromise(command: string, config?: {
38
39
  childProc.stderr?.on("data", (data) => {
39
40
  const chunk = data.toString();
40
41
  stderr += chunk;
41
- fullOutput += chunk;
42
+ if (config?.includeStderrInOutput) {
43
+ fullOutput += chunk;
44
+ }
42
45
 
43
46
  // Stream to console unless quiet mode
44
47
  if (!config?.quiet) {