File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
const write = s => process . stdout . write ( s ) ;
4
4
5
+ let login = '' ;
6
+ let password = '' ;
7
+
5
8
process . stdin . on ( 'data' , chunk => {
6
- write ( `\nHello, ${ chunk . toString ( ) . trim ( ) } !` ) ;
9
+ if ( ! login ) {
10
+ login = chunk . toString ( ) . trim ( ) ;
11
+ write ( '\x1b[13;34H' ) ;
12
+ } else {
13
+ password = chunk . toString ( ) . trim ( ) ;
14
+ write ( `\nHello, ${ login } !\n Your password is: ${ password } ` ) ;
15
+ }
7
16
} ) ;
8
17
9
18
write ( '\x1Bc' ) ;
@@ -15,9 +24,10 @@ setTimeout(() => {
15
24
} , 10000 ) ;
16
25
17
26
write ( `
18
- ┌────────────────────────────┐
19
- │ Login: │
20
- └────────────────────────────┘
27
+ ┌───────────────────────────────┐
28
+ │ Login: │
29
+ │ Password: │
30
+ └───────────────────────────────┘
21
31
` ) ;
22
32
23
- write ( '\x1b[2A \x1b[31C' ) ;
33
+ write ( '\x1b[3A \x1b[31C' ) ;
You can’t perform that action at this time.
0 commit comments