From 0c784f65338599104ca1f7e15150bd0b666fc28f Mon Sep 17 00:00:00 2001 From: anseki Date: Sun, 1 Mar 2015 23:46:52 +0900 Subject: [PATCH] Add `keyIn()`. --- lib/readline-sync.js | 11 ++++++++++- package.json | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/readline-sync.js b/lib/readline-sync.js index 64b0858..edb7e77 100644 --- a/lib/readline-sync.js +++ b/lib/readline-sync.js @@ -177,7 +177,7 @@ function _execSyncByFile(command, options) { } // for dev -exports.useShellSet = function(use) { useShell = use; }; +//exports.useShellSet = function(use) { useShell = use; }; exports.setPrint = function(fnc) { print = fnc; }; @@ -215,3 +215,12 @@ exports.question = function(query, options) { /* jshint eqnull:false */ options); }; + +exports.keyIn = function(message) { + return _readlineSync( +/* jshint eqnull:true */ + message != null ? message : '', +/* jshint eqnull:false */ + {keyIn: true}); +}; + diff --git a/package.json b/package.json index 4e6d5df..ebd55f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "readline-sync", - "version": "0.6.1", + "version": "0.7.0", "title": "readlineSync", "description": "Synchronous Readline", "keywords": [