Created
December 15, 2022 12:04
-
-
Save kuanyui/42c89825d73c2c6101c59fae0eeda251 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cliPrompt<T = string>(promptMsg: string): Promise<T> { | |
return new Promise((resolve, reject) => { | |
process.stdin.on("data", function(data: any) { | |
resolve(data.toString()) | |
process.stdin.end() | |
}) | |
process.stdout.write(promptMsg); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment