@j-o-r/sh 1.1.27 → 1.1.28

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/lib/SH.js CHANGED
@@ -215,10 +215,10 @@ const within = async (callback) => {
215
215
  */
216
216
  /**
217
217
  * Read entire stdin as UTF-8. If stdin is a TTY, resolves to an empty string.
218
- * @returns {Promise<string>}
218
+ * @returns {Promise<string|undefined>}
219
219
  */
220
220
  const readIn = async () => {
221
- if (process.stdin.isTTY) return ''; // nothing was piped
221
+ if (process.stdin.isTTY) return; // nothing was piped
222
222
  let buf = '';
223
223
  process.stdin.setEncoding('utf8');
224
224
  for await (const chunk of process.stdin) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@j-o-r/sh",
3
3
  "author": "Jorrit Duin <j-o-r@duin.work>",
4
4
  "type": "module",
5
- "version": "1.1.27",
5
+ "version": "1.1.28",
6
6
  "description": "Execute shell commands on Linux-based systems from javascript",
7
7
  "main": "lib/SH.js",
8
8
  "types": "types/SH.d.ts",
package/types/SH.d.ts CHANGED
@@ -69,9 +69,9 @@ export function retry(count: number, a: string | number | typeof expBackoff | Fu
69
69
  */
70
70
  /**
71
71
  * Read entire stdin as UTF-8. If stdin is a TTY, resolves to an empty string.
72
- * @returns {Promise<string>}
72
+ * @returns {Promise<string|undefined>}
73
73
  */
74
- export function readIn(): Promise<string>;
74
+ export function readIn(): Promise<string | undefined>;
75
75
  /**
76
76
  * Get user input from the command line (stdin)
77
77
  * void when input has been aborted