function readStdin() {
	return new Promise((resolve, reject) => {
		let content = "";
		let chunk = "";

		process.stdin
			.setEncoding("utf8")
			.on("readable", () => {
				while ((chunk = process.stdin.read()) !== null) {
					content += chunk;
				}
			})
			.on("end", () => resolve(content))
			.on("error", reject);
	});
}
Read data from stdin til the end.

Note: See
- https://github.com/nodejs/node/blob/master/doc/api/process.md#processstdin
- https://github.com/nodejs/node/blob/master/doc/api/process.md#a-note-on-process-io
- https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-01/msg00419.html
- https://github.com/nodejs/node/issues/7439 (historical)

On Windows using `fs.readFileSync(STDIN_FILE_DESCRIPTOR, "utf8")` seems
to read 4096 bytes before blocking and never drains to read further data.

The investigation on the Emacs thread indicates:

> Emacs on MS-Windows uses pipes to communicate with subprocesses; a
> pipe on Windows has a 4K buffer. So as soon as Emacs writes more than
> 4096 bytes to the pipe, the pipe becomes full, and Emacs then waits for
> the subprocess to read its end of the pipe, at which time Emacs will
> write the rest of the stuff.
@returns {Promise<string>} The read text.