Skip to content

Commit 56397df

Browse files
committed
completed 3-d step of the project
1 parent 1b5f007 commit 56397df

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

bin/brain-games.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
#!/usr/bin/env node
22

3-
console.log('Welcome to the Brain Games!')
3+
import runBrainGames from '../src/cli.js';
4+
5+
runBrainGames();

package-lock.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hexlet/code",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "[![Actions Status](https://github.com/Michael57e/qa-auto-engineer-javascript-project-44/actions/workflows/hexlet-check.yml/badge.svg)](https://github.com/Michael57e/qa-auto-engineer-javascript-project-44/actions)",
55
"homepage": "https://github.com/Michael57e/qa-auto-engineer-javascript-project-44#readme",
66
"bugs": {
@@ -18,6 +18,9 @@
1818
"test": "echo \"Error: no test specified\" && exit 1"
1919
},
2020
"bin": {
21-
"brain-games": "bin/brain-games.js"
21+
"brain-games": "bin/brain-games.js"
22+
},
23+
"dependencies": {
24+
"readline-sync": "^1.4.10"
2225
}
2326
}

src/cli.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import readlineSync from 'readline-sync';
2+
3+
export default function runBrainGames() {
4+
console.log('Welcome to the Brain Games!');
5+
const name = readlineSync.question('May I have your name? ');
6+
console.log(`Hello, ${name}!`);
7+
}

0 commit comments

Comments
 (0)