-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.js
41 lines (35 loc) · 878 Bytes
/
test.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
39
40
41
function fun() {
return new Promise((resolve, reject) => {
setTimeout(() => {
console.log(1);
resolve();
}, 3000);
});
}
function play() {
return new Promise((resolve, reject) => {
setTimeout(() => {
console.log(2);
}, 2000);
});
}
function main() {
//fun().then(() => play());
// play.then(res=>console.log(res));
fun()
.then(() => {
play();
});
}
main();
/* try {
await git().add('data.txt').commit('Another Commit!!', { '--date': date }).push();
} catch (error) {
console.log(error.message);
} */
/* try {
var writeStream = fs.createWriteStream('./data.txt', { 'flags': 'a' });
await writeStream.write(`\n Last Modified: ${date}`);
} catch (error) {
console.log(error.message);
} */