Fix: README
This commit is contained in:
parent
e9714a9a0a
commit
33653153dc
2 changed files with 10 additions and 16 deletions
24
README.md
24
README.md
|
@ -26,7 +26,7 @@ npm install readline-sync
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
### `question`
|
### question
|
||||||
|
|
||||||
```js
|
```js
|
||||||
line = readlineSync.question([query[, options]])
|
line = readlineSync.question([query[, options]])
|
||||||
|
@ -36,7 +36,7 @@ Displays the `query` to the user, and then returns the user's response after it
|
||||||
|
|
||||||
The `query` may be string, or may not be (e.g. number, Date, Object, etc.). This is converted to string (i.e. `toString` method is called) before it is displayed every time.
|
The `query` may be string, or may not be (e.g. number, Date, Object, etc.). This is converted to string (i.e. `toString` method is called) before it is displayed every time.
|
||||||
|
|
||||||
#### `noEchoBack`
|
#### noEchoBack
|
||||||
|
|
||||||
If `{noEchoBack: true}` is specified to `options`, echo back is avoided. It is used to hide the secret text (e.g. password) which is typed by user on screen.
|
If `{noEchoBack: true}` is specified to `options`, echo back is avoided. It is used to hide the secret text (e.g. password) which is typed by user on screen.
|
||||||
For example:
|
For example:
|
||||||
|
@ -53,11 +53,11 @@ PASSWORD :
|
||||||
Login ...
|
Login ...
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `noTrim`
|
#### noTrim
|
||||||
|
|
||||||
By default, the leading and trailing white spaces are removed from typed text. If `{noTrim: true}` is specified to `options`, those are not removed.
|
By default, the leading and trailing white spaces are removed from typed text. If `{noTrim: true}` is specified to `options`, those are not removed.
|
||||||
|
|
||||||
### `prompt`
|
### prompt
|
||||||
|
|
||||||
```js
|
```js
|
||||||
line = readlineSync.prompt([options])
|
line = readlineSync.prompt([options])
|
||||||
|
@ -65,15 +65,15 @@ line = readlineSync.prompt([options])
|
||||||
|
|
||||||
Displays the current prompt (See `setPrompt` method) to the user, and then returns the user's response after it has been typed.
|
Displays the current prompt (See `setPrompt` method) to the user, and then returns the user's response after it has been typed.
|
||||||
|
|
||||||
#### `noEchoBack`
|
#### noEchoBack
|
||||||
|
|
||||||
If `{noEchoBack: true}` is specified to `options`, echo back is avoided. It is used to hide the secret text (e.g. password) which is typed by user on screen. (See `noEchoBack` option of `question` method)
|
If `{noEchoBack: true}` is specified to `options`, echo back is avoided. It is used to hide the secret text (e.g. password) which is typed by user on screen. (See `noEchoBack` option of `question` method)
|
||||||
|
|
||||||
#### `noTrim`
|
#### noTrim
|
||||||
|
|
||||||
By default, the leading and trailing white spaces are removed from typed text. If `{noTrim: true}` is specified to `options`, those are not removed.
|
By default, the leading and trailing white spaces are removed from typed text. If `{noTrim: true}` is specified to `options`, those are not removed.
|
||||||
|
|
||||||
### `setPrompt`
|
### setPrompt
|
||||||
|
|
||||||
```js
|
```js
|
||||||
currentPrompt = readlineSync.setPrompt([prompt])
|
currentPrompt = readlineSync.setPrompt([prompt])
|
||||||
|
@ -93,7 +93,7 @@ readlineSync.setPrompt({
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
### `setEncoding`
|
### setEncoding
|
||||||
|
|
||||||
```js
|
```js
|
||||||
currentEncoding = readlineSync.setEncoding([encoding])
|
currentEncoding = readlineSync.setEncoding([encoding])
|
||||||
|
@ -101,7 +101,7 @@ currentEncoding = readlineSync.setEncoding([encoding])
|
||||||
|
|
||||||
Set the encoding method of input (user's response) and output (`prompt` method and `question` method). Defaults to 'utf8'.
|
Set the encoding method of input (user's response) and output (`prompt` method and `question` method). Defaults to 'utf8'.
|
||||||
|
|
||||||
### `setPrint`
|
### setPrint
|
||||||
|
|
||||||
```js
|
```js
|
||||||
readlineSync.setPrint([funcPrint])
|
readlineSync.setPrint([funcPrint])
|
||||||
|
@ -212,13 +212,7 @@ Someday, I may rewrite readlineSync to use child_process.execSync, or safety mod
|
||||||
|
|
||||||
## Release History
|
## Release History
|
||||||
* 2015-01-27 v0.5.0 Add `options.noTrim`.
|
* 2015-01-27 v0.5.0 Add `options.noTrim`.
|
||||||
* 2014-09-12 v0.4.8 fixed #9: Error of `stty` in read.sh.
|
|
||||||
* 2014-07-13 v0.4.3 fixed #6: Crypto input data.
|
|
||||||
* 2014-07-12 v0.4.2 `setPrompt()` and `setEncoding()` return current value.
|
|
||||||
* 2014-07-12 v0.4.1 `setPrompt()` and `question()` accept the value which is not string too (e.g. number, Date, Object, etc.).
|
|
||||||
* 2014-07-12 v0.4.0 Add `options.noEchoBack`.
|
* 2014-07-12 v0.4.0 Add `options.noEchoBack`.
|
||||||
* 2014-07-12 v0.3.0 Add `setPrint()`.
|
* 2014-07-12 v0.3.0 Add `setPrint()`.
|
||||||
* 2014-06-27 v0.2.3 Add alternative reading via shell on the environment which don't support interactively reading.
|
|
||||||
* 2013-12-18 v0.2.2 Error handle for the environment which don't support interactively reading from stdin.
|
|
||||||
* 2013-08-30 v0.2.0 Rewrite exporting methods.
|
* 2013-08-30 v0.2.0 Rewrite exporting methods.
|
||||||
* 2013-08-29 v0.1.0 Initial release.
|
* 2013-08-29 v0.1.0 Initial release.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "readline-sync",
|
"name": "readline-sync",
|
||||||
"version": "0.5.0",
|
"version": "0.5.1",
|
||||||
"title": "readlineSync",
|
"title": "readlineSync",
|
||||||
"description": "Synchronous Readline",
|
"description": "Synchronous Readline",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|
Loading…
Reference in a new issue