From 8e55e59cb46127ebca5cef34211e2f68b2446e3d Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 2 Apr 2022 22:03:04 -0700 Subject: [PATCH] doc: remove util.promisify() content in readline.md PR-URL: https://github.com/nodejs/node/pull/42552 Reviewed-By: Mestery Reviewed-By: Tierney Cyren Reviewed-By: Antoine du Hamel --- doc/api/readline.md | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/doc/api/readline.md b/doc/api/readline.md index a116106d4c5d9f..74f03f12ae4ece 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -355,25 +355,6 @@ signal.addEventListener('abort', () => { setTimeout(() => ac.abort(), 10000); ``` -If this method is invoked as it's util.promisify()ed version, it returns a -Promise that fulfills with the answer. If the question is canceled using -an `AbortController` it will reject with an `AbortError`. - -```js -const util = require('util'); -const question = util.promisify(rl.question).bind(rl); - -async function questionExample() { - try { - const answer = await question('What is you favorite food? '); - console.log(`Oh, so your favorite food is ${answer}`); - } catch (err) { - console.error('Question rejected', err); - } -} -questionExample(); -``` - ### `rl.resume()`