forked from waltcamine/ecommemrce_backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
43 lines (27 loc) · 695 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
42
43
const {select, insert} = require("./db");
async function hello(){
return new Promise(function(resolve, reject) {
resolve("3");
});
}
function hello2(){
return "3";
}
async function main(){
console.log("1");
setTimeout(() => {
console.log("2");
}, 0);
let product = await select("*", "products", {id : 99});
console.log(product);
console.log("4");
}
async function insert_products(){
for (const k in products) {
const product = products[k];
await insert("products", product);
console.log(`Je viens d'inserer ${product.id}`);
}
}
//insert_products();
//main()