From 4b033123d47248596204006c441652d8e6079704 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: Thu, 28 Sep 2023 16:52:47 +0300 Subject: [PATCH] add bin/brain-games.js package-lock.json package.json src/ --- bin/brain-games.js | 6 ++---- package-lock.json | 16 +++++++++++++++- package.json | 7 +++++-- src/cli.js | 4 ++++ 4 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 src/cli.js diff --git a/bin/brain-games.js b/bin/brain-games.js index 59a110a..883070a 100755 --- a/bin/brain-games.js +++ b/bin/brain-games.js @@ -1,7 +1,5 @@ #!/usr/bin/env node - -console.log('Welcome to the Brain Games!'); - import readlineSync from 'readline-sync'; +import { name } from 'src/cli.js' -const name = readlineSync.question('May I have your name? John'); +name(); diff --git a/package-lock.json b/package-lock.json index 28073e6..be5f98a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,21 @@ "": { "name": "@hexlet/code", "version": "1.0.0", - "license": "ISC" + "license": "ISC", + "dependencies": { + "readline-sync": "^1.4.10" + }, + "bin": { + "brain-games": "bin/brain-games.js" + } + }, + "node_modules/readline-sync": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/readline-sync/-/readline-sync-1.4.10.tgz", + "integrity": "sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==", + "engines": { + "node": ">= 0.8.0" + } } } } diff --git a/package.json b/package.json index 2d8af7c..3af49d0 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,15 @@ "version": "1.0.0", "description": "[![Actions Status](https://github.com/Tanya14081981/frontend-project-44/workflows/hexlet-check/badge.svg)](https://github.com/Tanya14081981/frontend-project-44/actions)", "bin": { - "brain-games": "bin/brain-games.js" + "brain-games": "bin/brain-games.js" }, "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", - "license": "ISC" + "license": "ISC", + "dependencies": { + "readline-sync": "^1.4.10" + } } diff --git a/src/cli.js b/src/cli.js new file mode 100644 index 0000000..5a9e93a --- /dev/null +++ b/src/cli.js @@ -0,0 +1,4 @@ +console.log('Welcome to the Brain Games!'); + +export const name = readlineSync.question('May I have your name?'); +console.log('Hello ' + name + '!'); \ No newline at end of file