From c1fbad930ce7dd0a786f77febce9dc276c08de14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B0=D1=82=D1=8C=D1=8F=D0=BD=D0=B0=20=D0=90=D0=BD?= =?UTF-8?q?=D0=B4=D1=80=D0=B5=D0=B5=D0=B2=D0=B0?= Date: Fri, 29 Sep 2023 10:18:49 +0300 Subject: [PATCH] add bin/brain-games.js src/cli.js --- bin/brain-games.js | 4 ++-- src/cli.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/brain-games.js b/bin/brain-games.js index 3bb6354..e1a6e3a 100755 --- a/bin/brain-games.js +++ b/bin/brain-games.js @@ -1,6 +1,6 @@ #!/usr/bin/env node import readlineSync from 'readline-sync'; -import { name } from '../src/cli.js' +import { greetGamer } from '../src/cli.js' -name(); +greetGamer(); diff --git a/src/cli.js b/src/cli.js index cd6d717..0976342 100644 --- a/src/cli.js +++ b/src/cli.js @@ -2,5 +2,7 @@ import readlineSync from 'readline-sync'; console.log('Welcome to the Brain Games!'); -export const name = () => readlineSync.question('May I have your name?'); -console.log(name ('Hello, ' + name + '!')); \ No newline at end of file +export const greetGamer = () => { +const name = readlineSync.question('May I have your name?'); +console.log('Hello, ' + name + '!') +};