From 304f1fcf86f38552d483eb69f6ccef331e691753 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Thu, 29 Mar 2012 13:15:24 -0700 Subject: [PATCH] tty: clarify that tty.setRawMode() has moved to process.stdin Technically saying `tty.ReadStream#setRawMode()` is correct, but since a typical use cannot instantiate `tty.ReadStream` themselves, and 99% of the time the only instance is `process.stdin`, then a little clarification seemed necessary. --- doc/api/tty.markdown | 3 ++- lib/tty.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/api/tty.markdown b/doc/api/tty.markdown index 57062945dc9..104fb8ca41e 100644 --- a/doc/api/tty.markdown +++ b/doc/api/tty.markdown @@ -24,7 +24,8 @@ terminal. ## tty.setRawMode(mode) -Deprecated. Use `tty.ReadStream#setRawMode()` instead. +Deprecated. Use `tty.ReadStream#setRawMode()` +(i.e. `process.stdin.setRawMode()`) instead. ## Class: ReadStream diff --git a/lib/tty.js b/lib/tty.js index c5fa64c3bb4..dc1c654c737 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -37,7 +37,7 @@ exports.setRawMode = function(flag) { } process.stdin.setRawMode(flag); }; -module.deprecate('setRawMode', 'Use `tty.ReadStream#setRawMode` instead.'); +module.deprecate('setRawMode', 'Use `process.stdin.setRawMode()` instead.'); function ReadStream(fd) {