-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtodo.js
38 lines (34 loc) · 1.06 KB
/
todo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const { addtodo } = require('./addtodo.js');
const { read_todos } = require('./read_todos.js');
const { deletetodo } = require('./deletetodo.js');
const { updatetodo } = require('./updatetodo.js');
const { read_todo } = require('./read_todo.js');
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
})
function operation() {
rl.question("Enter The Action Do You Want Like ( add , readtodos , readtodo , update , delete )? : ", action => {
switch (action) {
case 'add':
addtodo();
break;
case 'readtodos':
read_todos();
break;
case 'readtodo':
read_todo();
break;
case 'update':
updatetodo();
break;
case 'delete':
deletetodo();
break;
default:
console.log('Not Found Operation')
}
})
}
operation()