Files
  • index.js
  • .babelrc
  • appv1.js
  • package.json
index.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
import appv1 from './appv1';

console.log('Hello Node.js project.');

console.log('Merhaba Dunyaa');

function add(x, y = 10) {

    return x + y;
}

async function writeLog(msg){

    return new Promise((resolve, reject)=>{

        setTimeout(()=>resolve(msg), 8000);
    });
}

async function app(){

    //appv1();

    const a1 = await writeLog(add(40));

    console.log(a1);
}

app();
node v10.15.2 linux/amd64