feat(async-await): initial commit

This commit is contained in:
dancingCycle 2023-12-04 14:27:50 +01:00
parent e3faa5d815
commit c291026248
2 changed files with 23 additions and 0 deletions

12
async-await/index.js Normal file
View File

@ -0,0 +1,12 @@
function fetchDataFromApi() {
console.log('fetchDataFromApi() start...');
fetch('https://v2.jokeapi.dev/joke/Programming?type=single')
.then(res => res.json())
.then(json => console.log(json.joke));
console.log('fetchDataFromApi() done.');
};
fetchDataFromApi()
console.log('index: Finished fetching data.');

11
async-await/package.json Normal file
View File

@ -0,0 +1,11 @@
{
"name": "async-await",
"version": "1.0.0",
"description": "async await",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Software Ingenieur Begerad <dialog@SwIngBe.de>",
"license": "GPL-3.0-or-later"
}