dollar-shell
Advanced tools
Comparing version 1.0.5 to 1.1.0
{ | ||
"name": "dollar-shell", | ||
"description": "Run shell commands and use them in streams with ease in Node, Deno, Bun. Tiny, simple, no dependency package.", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"type": "module", | ||
@@ -49,3 +49,3 @@ "main": "./src/index.js", | ||
"devDependencies": { | ||
"tape-six": "^0.12.1", | ||
"tape-six": "^0.12.2", | ||
"typescript": "^5.6.2" | ||
@@ -52,0 +52,0 @@ }, |
@@ -207,2 +207,3 @@ # dollar-shell [![NPM version][npm-image]][npm-url] | ||
* 1.1.0 *Added `asDuplex` to the sub-process object.* | ||
* 1.0.5 *Updated dev dependencies.* | ||
@@ -209,0 +210,0 @@ * 1.0.4 *Fixed `raw()` for spawn commands.* |
@@ -33,2 +33,16 @@ /** | ||
/** | ||
* Object with readable and writable streams. It can be used as a duplex stream. | ||
*/ | ||
interface DuplexPair<R = any> { | ||
/** | ||
* The readable stream. | ||
*/ | ||
readable: ReadableStream<R>; | ||
/** | ||
* The writable stream. | ||
*/ | ||
writable: WritableStream<R>; | ||
} | ||
/** | ||
* Sub-process object. | ||
@@ -82,2 +96,7 @@ */ | ||
/** | ||
* Returns a duplex stream that can be used to pipe the input and output. | ||
* It is defined as `{readable: this.stdout, writable: this.stdin}`. | ||
*/ | ||
readonly asDuplex: DuplexPair<R>; | ||
/** | ||
* Kill the process. | ||
@@ -187,16 +206,2 @@ */ | ||
/** | ||
* Object with readable and writable streams. It can be used as a duplex stream. | ||
*/ | ||
interface DuplexPair<R = any> { | ||
/** | ||
* The readable stream. | ||
*/ | ||
readable: ReadableStream<R>; | ||
/** | ||
* The writable stream. | ||
*/ | ||
writable: WritableStream<R>; | ||
} | ||
/** | ||
* The type of the {@link $} function. | ||
@@ -203,0 +208,0 @@ */ |
@@ -53,3 +53,3 @@ // @ts-self-types="./index.d.ts" | ||
const sp = spawn(command, Object.assign({}, options, {stdin: 'pipe', stdout: 'pipe'})); | ||
return {readable: sp.stdout, writable: sp.stdin}; | ||
return sp.asDuplex; | ||
}); | ||
@@ -83,3 +83,3 @@ | ||
const sp = spawn(buildShellCommand(options?.shellPath, options?.shellArgs, command), Object.assign({}, options, {stdin: 'pipe', stdout: 'pipe'})); | ||
return {readable: sp.stdout, writable: sp.stdin}; | ||
return sp.asDuplex; | ||
}); | ||
@@ -86,0 +86,0 @@ |
@@ -57,2 +57,6 @@ 'use strict'; | ||
get asDuplex() { | ||
return {readable: this.stdout, writable: this.stdin}; | ||
} | ||
kill() { | ||
@@ -59,0 +63,0 @@ this.killed = true; |
@@ -66,2 +66,6 @@ 'use strict'; | ||
get asDuplex() { | ||
return {readable: this.stdout, writable: this.stdin}; | ||
} | ||
kill() { | ||
@@ -68,0 +72,0 @@ this.killed = true; |
@@ -64,2 +64,6 @@ 'use strict'; | ||
get asDuplex() { | ||
return {readable: this.stdout, writable: this.stdin}; | ||
} | ||
kill() { | ||
@@ -66,0 +70,0 @@ this.killed = true; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37248
754
214