+ Das
+ Promise
+ Objekt stellt eine Repräsentation einer eventuellen Ausführung (oder eines Fehlschlags) einer
+ asynchronen
+ Operation und den daraus resultierenden Ergebnissen dar.
+
+
+
+
+
+
+
diff --git a/02_advanced/unterricht/tag13/03_node-hello.js b/02_advanced/unterricht/tag13/03_node-hello.js
new file mode 100644
index 0000000..a420803
--- /dev/null
+++ b/02_advanced/unterricht/tag13/03_node-hello.js
@@ -0,0 +1 @@
+console.log('Hello World!');
diff --git a/02_advanced/unterricht/tag13/04_node-fs-promise.js b/02_advanced/unterricht/tag13/04_node-fs-promise.js
new file mode 100644
index 0000000..04c3295
--- /dev/null
+++ b/02_advanced/unterricht/tag13/04_node-fs-promise.js
@@ -0,0 +1,25 @@
+const fs = require('fs'); // Modul au der Standardlibrary von Node
+// require - commonjs Schreibweise
+
+const getFile = (path = '') => {
+ return new Promise((resolve, reject) => {
+ // asynchrones auslesen einer Datei
+ fs.readFile(path, 'utf-8', (error, data) => {
+ if (error) {
+ // console.error(error);
+ reject(error);
+ }
+
+ // console.log(data);
+ resolve(data);
+ });
+ });
+};
+
+console.log('weiter im code....');
+// more logic...
+
+// Funktionsaufruf einer Funktion, die asynchrone Prozesse beinhaltet
+getFile('02_promise-aufbau.html')
+ .then((data) => console.log(data))
+ .catch((err) => console.error(err));