diff options
author | gengjiawen <technicalcute@gmail.com> | 2018-12-19 17:51:30 +0300 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2019-04-16 04:37:03 +0300 |
commit | fe963149f6b2b4af7ace402851dc3dfed64ca2d5 (patch) | |
tree | 54af26168f1001b6186c3cc9ed79010ff05029e3 /lib/internal/main | |
parent | f3b5cc0807dbc35bb3742e0ab50a2d5f31704ce9 (diff) |
repl: add welcome message
PR-URL: https://github.com/nodejs/node/pull/25947
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Diffstat (limited to 'lib/internal/main')
-rw-r--r-- | lib/internal/main/repl.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/internal/main/repl.js b/lib/internal/main/repl.js index 6314453cd1b..d93314646e0 100644 --- a/lib/internal/main/repl.js +++ b/lib/internal/main/repl.js @@ -11,17 +11,21 @@ const { evalScript } = require('internal/process/execution'); +const console = require('internal/console/global'); + prepareMainThreadExecution(); // --entry-type flag not supported in REPL if (require('internal/options').getOptionValue('--entry-type')) { // If we can't write to stderr, we'd like to make this a noop, // so use console.error. - const { error } = require('internal/console/global'); - error('Cannot specify --entry-type for REPL'); + console.error('Cannot specify --entry-type for REPL'); process.exit(1); } +console.log(`Welcome to Node.js ${process.version}.\n` + + 'Type ".help" for more information.'); + const cliRepl = require('internal/repl'); cliRepl.createInternalRepl(process.env, (err, repl) => { if (err) { |