git.schokokeks.org
Repositories
Help
Report an Issue
fs-words.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
faf7e12
Branches
Tags
develop-client_server
master
typescript
fs-words.git
server
source
helpers
misc.ts
[mov] server
Christian Fraß
commited
faf7e12
at 2021-03-08 23:05:42
misc.ts
Blame
History
Raw
namespace helpers.misc { /** */ export function stdin ( ) : Promise<string> { return ( new Promise<string> ( (resolve, reject) => { const readline = require("readline"); const reader = readline.createInterface ( { "input": process.stdin, "output": process.stdout, "terminal": false } ); let lines : Array<string> = []; reader.on("line", (line) => lines.push(line)); reader.on("close", () => resolve(lines.join("\n"))); } ) ); } }