Permalink
Browse files

Remove 'num' option

  • Loading branch information...
1 parent 3007d65 commit 24076e1c2f4bda6b475908c79bafd566dad69907 @isaacs isaacs committed Jul 24, 2012
Showing with 9 additions and 17 deletions.
  1. +9 −17 README.md
View
@@ -1,5 +1,10 @@
+## read
+
For reading user input from stdin.
+Similar to the `readline` builtin's `question()` method, but with a
+few more features.
+
## USAGE
```javascript
@@ -8,7 +13,7 @@ read(options, callback)
```
The callback gets called with either the user input, or the default
-specified, or an error, in the traditional `callback(error, result)`
+specified, or an error, as `callback(error, result, isDefault)`
node style.
## OPTIONS
@@ -17,28 +22,15 @@ Every option is optional.
* `prompt` What to write to stdout before reading input.
* `silent` Don't echo the output as the user types it.
-* `num` Max number of chars to read from terminal.
* `timeout` Number of ms to wait for user input before giving up.
* `default` The default value if the user enters nothing.
+* `edit` Allow the user to edit the default value.
* `stdin` Readable stream to get input data from. (default `process.stdin`)
* `stdout` Writeable stream to write prompts to. (default: `process.stdout`)
-If silent is true, or num is set, and the input is a TTY,
-then read will set raw mode, and read character by character.
-
-At this time, backspace and arrow keys are not supported very well.
-It's probably not too hard to add support for this, perhaps using node's
-built-in readline module.
+If silent is true, and the input is a TTY, then read will set raw
+mode, and read character by character.
## CONTRIBUTING
Patches welcome.
-
-## BUGS
-
-In node 0.6.0 through 0.6.5, you must explicitly call
-`process.stdin.destroy()` or `process.exit()` when you know that your
-program is done reading, or else it will keep the event loop running
-forever.
-
-See: <https://github.com/joyent/node/issues/2257>

0 comments on commit 24076e1

Please sign in to comment.