feat: added 03_dom
This commit is contained in:
@@ -1,93 +0,0 @@
|
||||
# Linksammlung
|
||||
|
||||
## Repo
|
||||
|
||||
- <https://git.gkontra.de/ptorrel/JS>
|
||||
|
||||
## Allgemeine Links
|
||||
|
||||
- [StackOverflow Survey 2023](https://survey.stackoverflow.co/2023)
|
||||
- [StackOverflow Survey 2024](https://survey.stackoverflow.co/2024)
|
||||
- [StackOverflow Survey 2025](https://survey.stackoverflow.co/2025)
|
||||
- [State Of JS 2023](https://2023.stateofjs.com/en-US)
|
||||
- [State Of JS 2024](https://2024.stateofjs.com/en-US)
|
||||
- [State Of JS 2025](https://2025.stateofjs.com/en-US)
|
||||
- [Bootstrap 5](https://getbootstrap.com/)
|
||||
- [MDN - Mozilla Developer Network](https://developer.mozilla.org/)
|
||||
- [JavaScript Historie](https://de.wikipedia.org/wiki/JavaScript)
|
||||
- [Can I Use](https://caniuse.com/)
|
||||
- [ASCII Table](https://asciitable.xyz/)
|
||||
- [HTML Entities Liste (W3c)](https://dev.w3.org/html5/html-author/charref)
|
||||
- [HTML Entities & Tastaturkürzel](https://www.key-shortcut.com/html-entities/alle-entitaeten)
|
||||
- [What the f\*ck JS?](https://github.com/denysdovhan/wtfjs)
|
||||
- [CSS BEM (Block-Element-Modifier)](https://getbem.com/introduction/)
|
||||
|
||||
## Tools/ Software
|
||||
|
||||
- [Microsoft Powertoys](https://learn.microsoft.com/fr-fr/windows/powertoys/install?tabs=gh%2Cextract-094)
|
||||
- [Tipp10](https://online.tipp10.com/de/)
|
||||
- [NVM - Node Version Manager](https://github.com/coreybutler/nvm-windows/releases/download/1.2.2/nvm-setup.zip)
|
||||
- [Git - SCM](https://git-scm.com/)
|
||||
|
||||
## JS Tuts
|
||||
|
||||
- [JS CheatSheet](https://dev.to/devsmitra/28-javascript-array-hacks-a-cheat-sheet-for-developer-5769)
|
||||
|
||||
## CSS/SCSS Tuts
|
||||
|
||||
- [CSS Reference](https://cssreference.io/)
|
||||
- [CSS Tricks - Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/)
|
||||
- [CSS Flexboxfroggy](https://flexboxfroggy.com/#de)
|
||||
- [CSS Gridgarden](https://cssgridgarden.com/#de)
|
||||
|
||||
## JS Styleguide
|
||||
|
||||
- [AirBnb Styleguide](https://github.com/airbnb/javascript)
|
||||
- [Google](https://google.github.io/styleguide/jsguide.html)
|
||||
- [jQuery Styleguide](https://contribute.jquery.org/style-guide/js/)
|
||||
- [MDN (ES6) Styleguide](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Writing_style_guide/Code_style_guide/JavaScript)
|
||||
|
||||
## Fonts
|
||||
|
||||
- [Hack Font](https://sourcefoundry.org/hack/)
|
||||
- [Meslo Nerd Font](https://github.com/romkatv/powerlevel10k#fonts)
|
||||
- [Google Fonts Download](https://gwfh.mranftl.com/fonts)
|
||||
- [50 Best Google Fonts](https://www.pagecloud.com/blog/best-google-fonts-pairings)
|
||||
- [200 best google Webfonts](https://www.awwwards.com/20-best-web-fonts-from-google-web-fonts-and-font-face.html)
|
||||
- [Google Fonts](https://fonts.google.com/)
|
||||
- [FontAwesome](https://fontawesome.com/icons?d=gallery)
|
||||
- [FontSquirrl](https://www.fontsquirrel.com/)
|
||||
- [Dafont](https://www.dafont.com/de/)
|
||||
|
||||
## Bilder/ Vektoren
|
||||
|
||||
- [Freepik](https://www.freepik.com/)
|
||||
- [Flaticon](https://www.flaticon.com/)
|
||||
- [Pexels](https://www.pexels.com/de-de/)
|
||||
- [FavIcon Generator](https://realfavicongenerator.net/)
|
||||
|
||||
## Farben
|
||||
|
||||
- [CSS Gradient](https://cssgradient.io/)
|
||||
- [Color Adobe](https://color.adobe.com/de/create/color-wheel)
|
||||
- [Color Adobe Explore](https://color.adobe.com/de/explore)
|
||||
|
||||
## CSS/SCSS Tuts
|
||||
|
||||
- [CSS Reference](https://cssreference.io/)
|
||||
- [CSS Tricks - Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/)
|
||||
- [CSS Flexboxfroggy](https://flexboxfroggy.com/#de)
|
||||
- [CSS Gridgarden](https://cssgridgarden.com/#de)
|
||||
- [CSS Sticky Footer](https://css-tricks.com/couple-takes-sticky-footer/)
|
||||
- [SASS Structure YT](https://www.youtube.com/watch?v=9Ld-aOKsEDk&t=47s)
|
||||
- [SASS Structure Guidelines](https://sass-guidelin.es/#architecture)
|
||||
|
||||
## Terminals
|
||||
|
||||
- [iterm - Unix](https://iterm2.com/) - RECOMMENDED (WIN)
|
||||
- [Ghostty - Unix](https://ghostty.org/) - NEW
|
||||
- [Warp](https://www.warp.dev/) - NEW
|
||||
- [Hyper.js](https://hyper.is/)
|
||||
- [Windows Terminal](https://apps.microsoft.com/detail/9n0dx20hk701?icid=CNavAppsWindowsApps&hl=de-DE&gl=DE) - RECOMMENDED (WIN)
|
||||
- [Git Bash](https://git-scm.com/)
|
||||
- [Cmdr Terminal mit Bash](https://cmder.app/)
|
||||
@@ -1,10 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Übung 5: Summe einer Zahlenreihe rekursiv berechnen</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
@@ -28,10 +29,29 @@
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
const sumRecursive = (n) => {};
|
||||
const sumRecursive = (n) => {
|
||||
if (n === 0) {
|
||||
return 0;
|
||||
}
|
||||
return n + sumRecursive(n - 1); // 5 + 4 + 3 + 2 + 1 + 0
|
||||
};
|
||||
|
||||
const sumReduce = (n) => {
|
||||
return _.range(0, n + 1).reduce((a, b) => a + b, 0);
|
||||
};
|
||||
// Test Cases
|
||||
|
||||
console.log(_.range(5)); // => [0,1,2,3,4]
|
||||
console.log(_.range(2, 5)); // => [2,3,4]
|
||||
console.log(_.range(2, 10, 2)); // => [2,4,6,8]
|
||||
|
||||
console.time('recursive');
|
||||
console.log(sumRecursive(5)); // => 15 (5 + 4 + 3 + 2 + 1)
|
||||
console.timeEnd('recursive');
|
||||
|
||||
console.time('reduce');
|
||||
console.log(sumReduce(5)); // => 15 (5 + 4 + 3 + 2 + 1)
|
||||
console.timeEnd('reduce');
|
||||
console.log(sumRecursive(10)); // => 55 (10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1)
|
||||
console.log(sumRecursive(0)); // => 0
|
||||
</script>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
@@ -36,7 +36,17 @@
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
const combinations = (n, k) => {};
|
||||
const combinations = (n, k) => {
|
||||
if (k === 0 || k === n) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (k > n) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return combinations(n - 1, k - 1) + combinations(n - 1, k);
|
||||
};
|
||||
|
||||
// Test Cases
|
||||
console.log(combinations(5, 2)); // => 10
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
@@ -21,7 +21,26 @@
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
const sumNestedArray = (arr) => {};
|
||||
const sumNestedArray = (arr) => {
|
||||
// Basisfall: Wenn das Array leer ist, ist die Summe 0
|
||||
if (arr.length === 0) {
|
||||
return 0;
|
||||
}
|
||||
// Nimm das erste Element des Arrays
|
||||
const first = arr[0];
|
||||
const rest = arr.slice(1);
|
||||
let sumFirst = 0;
|
||||
|
||||
// Wenn das erste Element ein Array ist, rufe die Funktion rekursiv auf
|
||||
if (Array.isArray(first)) {
|
||||
sumFirst = sumNestedArray(first);
|
||||
} else if (!isNaN(first)) {
|
||||
// Wenn es eine Zahl ist, füge sie zur Summe hinzu
|
||||
sumFirst = Number(first);
|
||||
}
|
||||
// Rekursiver Fall: Summe des ersten Elements + Summe des restlichen Arrays
|
||||
return sumFirst + sumNestedArray(rest);
|
||||
};
|
||||
|
||||
// Test cases
|
||||
console.log(sumNestedArray([1, [2, [3, 4], 5], 6])); // => 21
|
||||
1
02_advanced/uebungen/u26_csv-quotes2/data/csvDatei.csv
Normal file
1
02_advanced/uebungen/u26_csv-quotes2/data/csvDatei.csv
Normal file
@@ -0,0 +1 @@
|
||||
"very big, soft computer mouse","the cutest peripheral ever",10,39.90
|
||||
|
11
02_advanced/uebungen/u26_csv-quotes2/data/products.csv
Normal file
11
02_advanced/uebungen/u26_csv-quotes2/data/products.csv
Normal file
@@ -0,0 +1,11 @@
|
||||
Code,Short Description,Tagline,Quantity,Price
|
||||
MUG0007,coffee mug with LCD level indicator,never again reach for the empty mug,20,49.90
|
||||
MUG0013,coffee mug with bluetooth-connected coffee grounds scanner for automatized fortune telling,put the smart into coffee reading,20,99.90
|
||||
OFF3145,pen with pre-warmed ink (tested on the South Pole),the pen is mightier than the cold,50,29.90
|
||||
COM1001,ambidextrous computer mouse,end the dictate of left and right,10,19.90
|
||||
COM0404,Easter egg themed webcam for your monitor,put an Easter egg on hardware too,20,149.90
|
||||
COM0001,Vulcan language vi cheatsheet,learn vi and Vulcan at the same time,3,9.90
|
||||
COM1536,Klingon language emacs cheatsheet,learn emacs and Klingon at the same time,50,9.90
|
||||
MOB0555,smartphone case with built-in screen,never miss a message,20,39.90
|
||||
|
||||
|
||||
|
58
02_advanced/uebungen/u26_csv-quotes2/index-andreas.js
Normal file
58
02_advanced/uebungen/u26_csv-quotes2/index-andreas.js
Normal file
@@ -0,0 +1,58 @@
|
||||
import fs from 'node:fs';
|
||||
import color from 'chalk';
|
||||
|
||||
const data = fs.readFileSync('data/products.csv', 'utf-8');
|
||||
const productAr = data.split('\n').map((row) => row.replace('\n', ''));
|
||||
const headerAr = productAr.shift().split(/\s*,\s*/);
|
||||
|
||||
console.log(productAr);
|
||||
|
||||
// console.log(headerAr);
|
||||
// console.log('=======');
|
||||
// console.log(productAr);
|
||||
|
||||
const convertCsvToJson = (products, headerAr) => {
|
||||
let jsonStr = '[\n';
|
||||
|
||||
products.forEach((row, idxRow) => {
|
||||
jsonStr += ' {\n';
|
||||
row
|
||||
.trim()
|
||||
.split(',')
|
||||
.forEach((elem, idxElem, ar) => {
|
||||
if (ar.length === idxElem + 1) {
|
||||
if (isNaN(elem)) {
|
||||
jsonStr += ` "${headerAr[idxElem]}": "${elem}"\n`;
|
||||
} else {
|
||||
jsonStr += ` "${headerAr[idxElem]}": ${Number(elem)}\n`;
|
||||
}
|
||||
} else {
|
||||
if (isNaN(elem)) {
|
||||
jsonStr += ` "${headerAr[idxElem]}": "${elem}",\n`;
|
||||
} else {
|
||||
jsonStr += ` "${headerAr[idxElem]}": ${Number(elem)},\n`;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (products.length === idxRow + 1) {
|
||||
jsonStr += ` }\n`;
|
||||
} else {
|
||||
jsonStr += ` },\n`;
|
||||
}
|
||||
});
|
||||
|
||||
jsonStr += ']';
|
||||
|
||||
console.log(color.yellow(`${jsonStr}`));
|
||||
|
||||
fs.writeFile('products.json', jsonStr, 'utf-8', (err) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
console.log(color.green('file created!'));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
convertCsvToJson(productAr, headerAr);
|
||||
21
02_advanced/uebungen/u26_csv-quotes2/index-ersin.js
Normal file
21
02_advanced/uebungen/u26_csv-quotes2/index-ersin.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import fs from 'node:fs';
|
||||
import papa from 'papaparse';
|
||||
|
||||
//https://www.npmjs.com/package/papaparse
|
||||
|
||||
const data = fs.readFileSync('data/csvDatei.csv', 'utf-8').trim();
|
||||
|
||||
const parsed = papa.parse(data, {
|
||||
dynamicTyping: true,
|
||||
});
|
||||
|
||||
const dataRow = parsed.data[0];
|
||||
|
||||
const result = {
|
||||
name: dataRow[0],
|
||||
description: dataRow[1],
|
||||
quantity: dataRow[2],
|
||||
price: dataRow[3],
|
||||
};
|
||||
|
||||
console.log(JSON.stringify(result, null, 2));
|
||||
62
02_advanced/uebungen/u26_csv-quotes2/index-phil.js
Normal file
62
02_advanced/uebungen/u26_csv-quotes2/index-phil.js
Normal file
@@ -0,0 +1,62 @@
|
||||
import fs from 'node:fs';
|
||||
import color from 'chalk';
|
||||
|
||||
const data = fs.readFileSync('data/products.csv', 'utf-8');
|
||||
|
||||
const toCamelCase = (str) => {
|
||||
return str
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.replace(/[^a-zA-Z0-9]+(.)/g, (match, chr) => chr.toUpperCase());
|
||||
};
|
||||
|
||||
const convertCsvToJson = (products, ar) => {
|
||||
const resultAr = products.map((str) => {
|
||||
const fields = str.split(/\s*,\s*/);
|
||||
|
||||
const labels = ar.map((label, idx) => {
|
||||
return [label, isNaN(fields[idx]) ? fields[idx] : Number(fields[idx])];
|
||||
});
|
||||
|
||||
const obj = Object.fromEntries(labels);
|
||||
|
||||
// console.log(labels); // Entries Array
|
||||
//console.log(obj);
|
||||
|
||||
return obj;
|
||||
|
||||
// return {
|
||||
// [ar[0]]: fields[0],
|
||||
// [ar[1]]: fields[1],
|
||||
// [ar[2]]: fields[2],
|
||||
// [ar[3]]: Number(fields[3]),
|
||||
// [ar[4]]: Number(fields[4]),
|
||||
// };
|
||||
});
|
||||
// console.log(resultAr);
|
||||
|
||||
const jsonStr = JSON.stringify(resultAr, '', 2);
|
||||
|
||||
fs.writeFile('products.json', jsonStr, 'utf-8', (err) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
console.log(color.green('file created!'));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const productAr = data
|
||||
.split('\n')
|
||||
.map((row) => row.replace('\n', ''))
|
||||
.filter((row) => row !== '');
|
||||
|
||||
const headerAr = productAr
|
||||
.shift()
|
||||
.split(/\s*,\s*/)
|
||||
.map(toCamelCase);
|
||||
|
||||
// console.log('=======');
|
||||
// console.log(productAr);
|
||||
|
||||
convertCsvToJson(productAr, headerAr);
|
||||
35
02_advanced/uebungen/u26_csv-quotes2/package-lock.json
generated
Normal file
35
02_advanced/uebungen/u26_csv-quotes2/package-lock.json
generated
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "u26_csv-quotes2",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "u26_csv-quotes2",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"chalk": "^5.6.2",
|
||||
"papaparse": "^5.5.4"
|
||||
}
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "5.6.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
|
||||
"integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^12.17.0 || ^14.13 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/papaparse": {
|
||||
"version": "5.5.4",
|
||||
"resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.5.4.tgz",
|
||||
"integrity": "sha512-SwzWD9gl/ElwYLCI0nUja1mFJzjq2D8ziShfNBa7zCHzkOozeOGDwHWQ+tvCzEZcewecWZ5U7kUopDnG+DFYEQ==",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
}
|
||||
17
02_advanced/uebungen/u26_csv-quotes2/package.json
Normal file
17
02_advanced/uebungen/u26_csv-quotes2/package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "u26_csv-quotes2",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"chalk": "^5.6.2",
|
||||
"papaparse": "^5.5.4"
|
||||
}
|
||||
}
|
||||
58
02_advanced/uebungen/u26_csv-quotes2/products.json
Normal file
58
02_advanced/uebungen/u26_csv-quotes2/products.json
Normal file
@@ -0,0 +1,58 @@
|
||||
[
|
||||
{
|
||||
"code": "MUG0007",
|
||||
"shortDescription": "coffee mug with LCD level indicator",
|
||||
"tagline": "never again reach for the empty mug",
|
||||
"quantity": 20,
|
||||
"price": 49.9
|
||||
},
|
||||
{
|
||||
"code": "MUG0013",
|
||||
"shortDescription": "coffee mug with bluetooth-connected coffee grounds scanner for automatized fortune telling",
|
||||
"tagline": "put the smart into coffee reading",
|
||||
"quantity": 20,
|
||||
"price": 99.9
|
||||
},
|
||||
{
|
||||
"code": "OFF3145",
|
||||
"shortDescription": "pen with pre-warmed ink (tested on the South Pole)",
|
||||
"tagline": "the pen is mightier than the cold",
|
||||
"quantity": 50,
|
||||
"price": 29.9
|
||||
},
|
||||
{
|
||||
"code": "COM1001",
|
||||
"shortDescription": "ambidextrous computer mouse",
|
||||
"tagline": "end the dictate of left and right",
|
||||
"quantity": 10,
|
||||
"price": 19.9
|
||||
},
|
||||
{
|
||||
"code": "COM0404",
|
||||
"shortDescription": "Easter egg themed webcam for your monitor",
|
||||
"tagline": "put an Easter egg on hardware too",
|
||||
"quantity": 20,
|
||||
"price": 149.9
|
||||
},
|
||||
{
|
||||
"code": "COM0001",
|
||||
"shortDescription": "Vulcan language vi cheatsheet",
|
||||
"tagline": "learn vi and Vulcan at the same time",
|
||||
"quantity": 3,
|
||||
"price": 9.9
|
||||
},
|
||||
{
|
||||
"code": "COM1536",
|
||||
"shortDescription": "Klingon language emacs cheatsheet",
|
||||
"tagline": "learn emacs and Klingon at the same time",
|
||||
"quantity": 50,
|
||||
"price": 9.9
|
||||
},
|
||||
{
|
||||
"code": "MOB0555",
|
||||
"shortDescription": "smartphone case with built-in screen",
|
||||
"tagline": "never miss a message",
|
||||
"quantity": 20,
|
||||
"price": 39.9
|
||||
}
|
||||
]
|
||||
BIN
02_advanced/uebungen/u27_zlip.zip
Normal file
BIN
02_advanced/uebungen/u27_zlip.zip
Normal file
Binary file not shown.
51
02_advanced/uebungen/u27_zlip/Regex-erklaerung.md
Normal file
51
02_advanced/uebungen/u27_zlip/Regex-erklaerung.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# Regex Beispiel
|
||||
|
||||
Am besten löst man das mit einem regulären Ausdruck, der entweder nach **Inhalten in Anführungszeichen** sucht _oder_ nach **Inhalten ohne Kommas**.
|
||||
|
||||
Hier ist der passende Reguläre Ausdruck:
|
||||
|
||||
`/"([^"\\]*(?:\\.[^"\\]*)*)"|([^,]+)/g`
|
||||
|
||||
---
|
||||
|
||||
### Wie der Regex funktioniert
|
||||
|
||||
Der Ausdruck nutzt das **ODER-Prinzip (`|`)**, um zwei Szenarien zu matchen:
|
||||
|
||||
1. **`"([^"\\]*(?:\\.[^"\\]*)*)"` (Gruppe 1):** Matcht alles, was in doppelten Anführungszeichen steht. Er erlaubt sogar escaped Anführungszeichen (`\"`) im Text.
|
||||
2. **`([^,]+)` (Gruppe 2):** Wenn keine Anführungszeichen da sind, matcht er alles bis zum nächsten Komma.
|
||||
|
||||
---
|
||||
|
||||
### Anwendung in JavaScript (Beispiel)
|
||||
|
||||
Da du das Ergebnis sicherlich in einem Array von einzelnen Werten brauchst, kannst du den Regex wie folgt anwenden. Hierbei nutzen wir `matchAll`, um die Treffer sauber zu trennen und die Anführungszeichen direkt zu entfernen:
|
||||
|
||||
```javascript
|
||||
const input = '"very big, soft computer mouse","the cutest peripheral ever",10,39.90';
|
||||
const regex = /"([^"\\]*(?:\\.[^"\\]*)*)"|([^,]+)/g;
|
||||
|
||||
const matches = [...input.matchAll(regex)];
|
||||
|
||||
const result = matches.map((match) => {
|
||||
// Wenn Gruppe 1 existiert, war es ein String in Anführungszeichen
|
||||
// Wenn Gruppe 2 existiert, war es ein unberührter Wert (Zahl)
|
||||
const value = match[1] !== undefined ? match[1] : match[2].trim();
|
||||
|
||||
// Optional: Datentypen konvertieren
|
||||
if (!isNaN(value) && value !== '') {
|
||||
return Number(value);
|
||||
}
|
||||
return value;
|
||||
});
|
||||
|
||||
console.log(result);
|
||||
```
|
||||
|
||||
### Das Ergebnis (Output)
|
||||
|
||||
Nach dem Parsen erhältst du ein sauberes Array, bei dem die Kommas innerhalb der Strings ignoriert wurden und die Zahlen einsatzbereit sind:
|
||||
|
||||
```json
|
||||
["very big, soft computer mouse", "the cutest peripheral ever", 10, 39.9]
|
||||
```
|
||||
1
02_advanced/uebungen/u27_zlip/data/csvDatei.csv
Normal file
1
02_advanced/uebungen/u27_zlip/data/csvDatei.csv
Normal file
@@ -0,0 +1 @@
|
||||
"very big, soft computer mouse","the cutest peripheral ever",10,39.90
|
||||
|
11
02_advanced/uebungen/u27_zlip/data/products.csv
Normal file
11
02_advanced/uebungen/u27_zlip/data/products.csv
Normal file
@@ -0,0 +1,11 @@
|
||||
Code,Short Description,Tagline,Quantity,Price
|
||||
MUG0007,coffee mug with LCD level indicator,never again reach for the empty mug,20,49.90
|
||||
MUG0013,coffee mug with bluetooth-connected coffee grounds scanner for automatized fortune telling,put the smart into coffee reading,20,99.90
|
||||
OFF3145,pen with pre-warmed ink (tested on the South Pole),the pen is mightier than the cold,50,29.90
|
||||
COM1001,ambidextrous computer mouse,end the dictate of left and right,10,19.90
|
||||
COM0404,Easter egg themed webcam for your monitor,put an Easter egg on hardware too,20,149.90
|
||||
COM0001,Vulcan language vi cheatsheet,learn vi and Vulcan at the same time,3,9.90
|
||||
COM1536,Klingon language emacs cheatsheet,learn emacs and Klingon at the same time,50,9.90
|
||||
MOB0555,smartphone case with built-in screen,never miss a message,20,39.90
|
||||
|
||||
|
||||
|
63
02_advanced/uebungen/u27_zlip/index.js
Normal file
63
02_advanced/uebungen/u27_zlip/index.js
Normal file
@@ -0,0 +1,63 @@
|
||||
import fs from 'node:fs';
|
||||
import zlib from 'node:zlib';
|
||||
import color from 'chalk';
|
||||
|
||||
const data = fs.readFileSync('data/products.csv', 'utf-8');
|
||||
|
||||
const toCamelCase = (str) => {
|
||||
return str
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.replace(/[^a-zA-Z0-9]+(.)/g, (match, chr) => chr.toUpperCase());
|
||||
};
|
||||
|
||||
const convertCsvToJson = (products, ar) => {
|
||||
const resultAr = products.map((str) => {
|
||||
const fields = str.split(/\s*,\s*/);
|
||||
|
||||
const labels = ar.map((label, idx) => {
|
||||
return [label, isNaN(fields[idx]) ? fields[idx] : Number(fields[idx])];
|
||||
});
|
||||
|
||||
const obj = Object.fromEntries(labels);
|
||||
|
||||
// console.log(labels); // Entries Array
|
||||
//console.log(obj);
|
||||
|
||||
return obj;
|
||||
|
||||
// return {
|
||||
// [ar[0]]: fields[0],
|
||||
// [ar[1]]: fields[1],
|
||||
// [ar[2]]: fields[2],
|
||||
// [ar[3]]: Number(fields[3]),
|
||||
// [ar[4]]: Number(fields[4]),
|
||||
// };
|
||||
});
|
||||
// console.log(resultAr);
|
||||
|
||||
const jsonStr = JSON.stringify(resultAr, '', 2);
|
||||
|
||||
fs.writeFile('products.json.gz', zlib.gzipSync(jsonStr), 'utf-8', (err) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
} else {
|
||||
console.log(color.green('file created!'));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const productAr = data
|
||||
.split('\n')
|
||||
.map((row) => row.replace('\n', ''))
|
||||
.filter((row) => row !== '');
|
||||
|
||||
const headerAr = productAr
|
||||
.shift()
|
||||
.split(/\s*,\s*/)
|
||||
.map(toCamelCase);
|
||||
|
||||
// console.log('=======');
|
||||
// console.log(productAr);
|
||||
|
||||
convertCsvToJson(productAr, headerAr);
|
||||
17
02_advanced/uebungen/u27_zlip/package.json
Normal file
17
02_advanced/uebungen/u27_zlip/package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "u27_zlib",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"chalk": "^5.6.2",
|
||||
"papaparse": "^5.5.4"
|
||||
}
|
||||
}
|
||||
BIN
02_advanced/uebungen/u27_zlip/products.json.gz
Normal file
BIN
02_advanced/uebungen/u27_zlip/products.json.gz
Normal file
Binary file not shown.
54
02_advanced/uebungen/u28_password-generator/index.js
Normal file
54
02_advanced/uebungen/u28_password-generator/index.js
Normal file
@@ -0,0 +1,54 @@
|
||||
// const crypto = require('node:crypto');
|
||||
import crypto from 'node:crypto';
|
||||
import _ from 'lodash';
|
||||
|
||||
const PASSWORD_LENGTH = 10;
|
||||
const s = '23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ!.,;#$%/+*';
|
||||
|
||||
const buf = crypto.randomBytes(PASSWORD_LENGTH);
|
||||
|
||||
console.log(buf, Array.from(buf));
|
||||
|
||||
const password = Array.from(buf)
|
||||
.map((byte) => s.charAt(byte % s.length))
|
||||
.join('');
|
||||
|
||||
const getPassword = (amount = 10) => {
|
||||
const chars = '23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ!.,;#$%/+*'.split('');
|
||||
return _.shuffle(chars).slice(0, amount).join('');
|
||||
};
|
||||
|
||||
console.log(password);
|
||||
console.log(getPassword());
|
||||
|
||||
// Source - https://stackoverflow.com/a/2450976
|
||||
// Posted by ChristopheD, modified by community. See post 'Timeline' for change history
|
||||
// Retrieved 2026-07-10, License - CC BY-SA 4.0
|
||||
|
||||
function shuffle(array) {
|
||||
let currentIndex = array.length;
|
||||
|
||||
// While there remain elements to shuffle...
|
||||
while (currentIndex != 0) {
|
||||
// Pick a remaining element...
|
||||
let randomIndex = Math.floor(Math.random() * currentIndex);
|
||||
currentIndex--;
|
||||
|
||||
// And swap it with the current element.
|
||||
[array[currentIndex], array[randomIndex]] = [array[randomIndex], array[currentIndex]];
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
// Used like so
|
||||
let arr = [2, 11, 37, 42];
|
||||
shuffle(arr);
|
||||
console.log(arr);
|
||||
|
||||
// Übung 28: Passwortgenerator
|
||||
|
||||
// Was macht der folgende Code?
|
||||
|
||||
// OK: Der Titel verrät es schon. Versuche dennoch, das Programm zu verstehen! Benutze die Dokumentation der Standardbibliothek, um nachzuschlagen, was crypto.randomBytes(…) genau macht!
|
||||
|
||||
// Bonusfrage: Warum sind in den Zeichen «1», «i» und «l» nicht enthalten, genau so wenig wie «0» und «o»?
|
||||
21
02_advanced/uebungen/u28_password-generator/package-lock.json
generated
Normal file
21
02_advanced/uebungen/u28_password-generator/package-lock.json
generated
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "u28_password-generator",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "u28_password-generator",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"lodash": "^4.18.1"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.18.1",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz",
|
||||
"integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
}
|
||||
14
02_advanced/uebungen/u28_password-generator/package.json
Normal file
14
02_advanced/uebungen/u28_password-generator/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "u28_password-generator",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"lodash": "^4.18.1"
|
||||
}
|
||||
}
|
||||
BIN
02_advanced/uebungen/u29_stream.zip
Normal file
BIN
02_advanced/uebungen/u29_stream.zip
Normal file
Binary file not shown.
8769
02_advanced/uebungen/u29_stream/data/products.html
Normal file
8769
02_advanced/uebungen/u29_stream/data/products.html
Normal file
File diff suppressed because it is too large
Load Diff
BIN
02_advanced/uebungen/u29_stream/data/products.html.gz
Normal file
BIN
02_advanced/uebungen/u29_stream/data/products.html.gz
Normal file
Binary file not shown.
21
02_advanced/uebungen/u29_stream/index.js
Normal file
21
02_advanced/uebungen/u29_stream/index.js
Normal file
@@ -0,0 +1,21 @@
|
||||
// const fs = require('node:fs');
|
||||
// const zlib = require('node:zlib');
|
||||
import fs from 'node:fs';
|
||||
import zlib from 'node:zlib';
|
||||
|
||||
const gzipCompressor = zlib.createGzip();
|
||||
|
||||
const inputStream = fs.createReadStream('data/products.html');
|
||||
const outputStream = fs.createWriteStream('data/products.html.gz');
|
||||
|
||||
inputStream.on('data', (data) => {
|
||||
console.log('Pakete (data chunks) werden geladen: ', data.length);
|
||||
//outputStream.write(zlib.gzipSync(data));
|
||||
});
|
||||
|
||||
inputStream.pipe(gzipCompressor).pipe(outputStream);
|
||||
|
||||
// Übung 29: Datenströme
|
||||
// Schreibe Codebeispiel 239 um, ohne die Funktion pipe(…) zu verwenden!
|
||||
|
||||
// TIPP: Um eine Datei päckchenweise lesen- und schreiben zu können, gibt es für das fs Modul die Methoden createReadStream und createWriteStream.
|
||||
13
02_advanced/uebungen/u29_stream/package.json
Normal file
13
02_advanced/uebungen/u29_stream/package.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "03_stream",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"type": "module"
|
||||
}
|
||||
BIN
02_advanced/uebungen/u32_os-info.zip
Normal file
BIN
02_advanced/uebungen/u32_os-info.zip
Normal file
Binary file not shown.
35
02_advanced/uebungen/u32_os-info/index.js
Normal file
35
02_advanced/uebungen/u32_os-info/index.js
Normal file
@@ -0,0 +1,35 @@
|
||||
import os from 'node:os';
|
||||
import color from 'chalk';
|
||||
|
||||
const platform = os.platform();
|
||||
|
||||
const cpu = os.cpus().length;
|
||||
|
||||
console.log(color.yellow(`I am running on a machine with ${platform} and ${cpu} cores.`));
|
||||
|
||||
//console.log(os.cpus()); //gibt ein array aus jeweils cpu kernen
|
||||
console.log(os.type()); // Darwin
|
||||
console.log(os.version()); // Darwin mit kernelversion
|
||||
console.log(os.totalmem()); //RAM in bytes
|
||||
console.log(os.freemem());
|
||||
console.log(os.availableParallelism()); // 8 -> ein programm sollte max 8 parallele tasks ausführen?
|
||||
console.log(os.arch()); // cpu architektur -> arm64
|
||||
console.log(os.machine()); // arm64
|
||||
//console.log(os.networkInterfaces());
|
||||
console.log(os.hostname()); //MacBookAir
|
||||
console.log(os.release()); // die releasenr und nicht datum
|
||||
console.log(os.userInfo()); // Object mit Userinfos
|
||||
console.log(os.userInfo().username);
|
||||
|
||||
// Übung 32: Information zum Betriebssystem und der Anzahl der vorhandenen CPUs
|
||||
|
||||
// Im Kontext einer Monitoring-Lösung benötigt ein Kunde eine kleine CLI (Command Line Interface)-Anwendung, die es erlaubt, das aktuelle Betriebssystem und die Anzahl der CPUs auf dem jeweiligen Rechner zu ermitteln.
|
||||
|
||||
// Vorgehensweise
|
||||
|
||||
// 1.Schau dir die Online-Dokumentation zum os-Modul der Standardbibliothek an.
|
||||
// 2.Erstelle dann ein kurzes Node.js-Programm, das ausgibt, auf welcher Plattform es gerade läuft (also etwa »linux«, »darwin« (OS X) oder »win32«) und wie viele Kerne der Rechner hat.
|
||||
|
||||
// Hier eine mögliche Beispielausgabe:
|
||||
|
||||
// I am running on a machine with linux and 2 cores.
|
||||
27
02_advanced/uebungen/u32_os-info/package-lock.json
generated
Normal file
27
02_advanced/uebungen/u32_os-info/package-lock.json
generated
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "u32_os-info",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "u32_os-info",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"chalk": "^5.6.2"
|
||||
}
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "5.6.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
|
||||
"integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^12.17.0 || ^14.13 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
14
02_advanced/uebungen/u32_os-info/package.json
Normal file
14
02_advanced/uebungen/u32_os-info/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "u32_os-info",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"chalk": "^5.6.2"
|
||||
}
|
||||
}
|
||||
@@ -1,31 +1,31 @@
|
||||
'use strict';
|
||||
"use strict";
|
||||
(() => {
|
||||
// dev/assets/js/main.js
|
||||
(() => {
|
||||
const DOM = {
|
||||
weatherBox: document.querySelector('.weather-box'),
|
||||
weatherIcon: document.querySelector('.weather-pic img'),
|
||||
figcaption: document.querySelector('figcaption'),
|
||||
description: document.querySelector('.description'),
|
||||
temp: document.querySelector('.temp'),
|
||||
tempMin: document.querySelector('.temp-min'),
|
||||
tempMax: document.querySelector('.temp-max'),
|
||||
windIcon: document.querySelector('.wind-icon'),
|
||||
speed: document.querySelector('.speed'),
|
||||
deg: document.querySelector('.deg'),
|
||||
weatherBox: document.querySelector(".weather-box"),
|
||||
weatherIcon: document.querySelector(".weather-pic img"),
|
||||
figcaption: document.querySelector("figcaption"),
|
||||
description: document.querySelector(".description"),
|
||||
temp: document.querySelector(".temp"),
|
||||
tempMin: document.querySelector(".temp-min"),
|
||||
tempMax: document.querySelector(".temp-max"),
|
||||
windIcon: document.querySelector(".wind-icon"),
|
||||
speed: document.querySelector(".speed"),
|
||||
deg: document.querySelector(".deg")
|
||||
};
|
||||
console.log(DOM);
|
||||
const API_KEY = '';
|
||||
const API_KEY = "";
|
||||
const LAT = 43.72072300281546;
|
||||
const LON = 7.352450291796612;
|
||||
const TEMP_MAX_ALERT_AMOUNT = 30;
|
||||
const TEMP_MIN_ALERT_AMOUNT = 10;
|
||||
const init = () => {
|
||||
console.log('init!');
|
||||
console.log("init!");
|
||||
getWeather().then((data) => {
|
||||
console.log(data);
|
||||
if (data) {
|
||||
DOM.weatherBox.classList.add('show', 'animate__flipInX');
|
||||
DOM.weatherBox.classList.add("show", "animate__flipInX");
|
||||
setWeather(data);
|
||||
}
|
||||
});
|
||||
@@ -33,9 +33,9 @@
|
||||
const getWeather = async () => {
|
||||
try {
|
||||
const res = await fetch(
|
||||
`https://api.openweathermap.org/data/2.5/weather?lat=${LAT}&lon=${LON}&units=metric&appid=${API_KEY}`,
|
||||
`https://api.openweathermap.org/data/2.5/weather?lat=${LAT}&lon=${LON}&units=metric&appid=${API_KEY}`
|
||||
);
|
||||
if (!res.ok) throw new Error('Fetch Error');
|
||||
if (!res.ok) throw new Error("Fetch Error");
|
||||
const data = await res.json();
|
||||
return data;
|
||||
} catch (error) {
|
||||
@@ -57,9 +57,9 @@
|
||||
DOM.weatherIcon.src = `https://openweathermap.org/img/wn/${icon}@2x.png`;
|
||||
DOM.windIcon.style.transform = `rotate(${Number(deg) - 45}deg)`;
|
||||
if (Number(temp) >= TEMP_MAX_ALERT_AMOUNT) {
|
||||
DOM.temp.classList.add('danger');
|
||||
DOM.temp.classList.add("danger");
|
||||
} else if (Number(temp) <= TEMP_MIN_ALERT_AMOUNT) {
|
||||
DOM.temp.classList.add('frozen');
|
||||
DOM.temp.classList.add("frozen");
|
||||
}
|
||||
};
|
||||
init();
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
// BITTE EIGENEN API KEY VERWENDEN
|
||||
// (NICHT DIESEN KEY VERWENDEN: b62eaccfd1a09cf1d04b00bd2ec689e7)
|
||||
const API_KEY = '';
|
||||
|
||||
// https://www.latlong.net/
|
||||
const LAT = 43.72072300281546;
|
||||
const LON = 7.352450291796612;
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ const fs = require('fs');
|
||||
|
||||
// asnyc prozess
|
||||
fs.readFile('data/products.csv', 'UTF8', (error, data) => {
|
||||
console.log(data); // 2 output
|
||||
console.log('second output:', data); // 2 output
|
||||
});
|
||||
|
||||
for (let i = 0; i < 2000000000; i++) {
|
||||
// be busy for a few seconds
|
||||
}
|
||||
console.log('ready'); // 1 output
|
||||
console.log('first output: ', '... more code ...'); // 1 output
|
||||
|
||||
1
02_advanced/unterricht/tag20/01_fs-methoden/hello.txt
Normal file
1
02_advanced/unterricht/tag20/01_fs-methoden/hello.txt
Normal file
@@ -0,0 +1 @@
|
||||
hello World
|
||||
54
02_advanced/unterricht/tag20/01_fs-methoden/index.js
Normal file
54
02_advanced/unterricht/tag20/01_fs-methoden/index.js
Normal file
@@ -0,0 +1,54 @@
|
||||
import fs from 'fs'; // Modul aus der Standardbibliothek
|
||||
|
||||
let data;
|
||||
|
||||
fs.writeFileSync('hello.txt', 'hello World', 'utf8');
|
||||
|
||||
// fs.readFileSync(…)
|
||||
// liest eine Datei ein (blockierende Variante)
|
||||
data = fs.readFileSync('hello.txt', 'utf8');
|
||||
|
||||
console.log(data);
|
||||
|
||||
// fs.readFile(…)
|
||||
// liest eine Datei ein (asynchrone Variante)
|
||||
fs.readFile('hello.txt', 'utf8', (error, data) => {
|
||||
console.log(data);
|
||||
});
|
||||
|
||||
// fs.writeFileSync(…)
|
||||
// schreibt Daten in eine Datei; bereits vorhandene Daten werden überschrieben (blockierende Variante)
|
||||
fs.writeFileSync('hello.txt', data, 'utf8');
|
||||
|
||||
console.log(data);
|
||||
|
||||
// fs.writeFile(…)
|
||||
// schreibt Daten in eine Datei; bereits vorhandene Daten werden überschrieben (asynchrone Variante)
|
||||
fs.writeFile('hello.txt', data, 'UTF8', (error) => {
|
||||
if (error) console.log('Error: ' + error);
|
||||
});
|
||||
|
||||
// fs.statSync(…)
|
||||
// ermittelt Infos zur Datei (blockierende Variante)
|
||||
const stats = fs.statSync('hello.txt');
|
||||
|
||||
// console.log('File Stats: ', stats);
|
||||
|
||||
console.log('File size: ', stats.size); // => size in bytes
|
||||
console.log('File birthdate: ', stats.birthtime); // => enstehungsdatum der Datei
|
||||
|
||||
// fs.stat(…)
|
||||
// ermittelt Infos zur Datei (asynchrone Variante)
|
||||
fs.stat('hello.txt', (error, stats) => console.log(stats.size)); // => size in bytes
|
||||
|
||||
// fs.unlinkSync(…)
|
||||
// löscht eine Datei (blockierende Variante)
|
||||
fs.unlinkSync('hello.txt');
|
||||
|
||||
fs.writeFileSync('hello.txt', 'hello World', 'utf8');
|
||||
|
||||
// fs.unlink(…)
|
||||
// löscht eine Datei (asynchrone Variante)
|
||||
// fs.unlink('hello.txt', 'utf-8', (error) => {
|
||||
// if (error) console.log('Error: ' + error);
|
||||
// });
|
||||
13
02_advanced/unterricht/tag20/01_fs-methoden/package.json
Normal file
13
02_advanced/unterricht/tag20/01_fs-methoden/package.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "01_fs-methoden",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"type": "module"
|
||||
}
|
||||
58
02_advanced/unterricht/tag20/02_zlib/data/products.html
Normal file
58
02_advanced/unterricht/tag20/02_zlib/data/products.html
Normal file
@@ -0,0 +1,58 @@
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Products</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="container py-5">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
<h2>coffee mug with LCD level indicator</h2>
|
||||
<p>never again reach for the empty mug</p>
|
||||
<p><strong>Price:</strong> $49.90</p>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<h2>coffee mug with bluetooth-connected coffee grounds scanner for automatized fortune telling</h2>
|
||||
<p>put the smart into coffee reading</p>
|
||||
<p><strong>Price:</strong> $99.90</p>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<h2>pen with pre-warmed ink (tested on the South Pole)</h2>
|
||||
<p>the pen is mightier than the cold</p>
|
||||
<p><strong>Price:</strong> $29.90</p>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<h2>ambidextrous computer mouse</h2>
|
||||
<p>end the dictate of left and right</p>
|
||||
<p><strong>Price:</strong> $19.90</p>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<h2>Easter egg themed webcam for your monitor</h2>
|
||||
<p>put an Easter egg on hardware too</p>
|
||||
<p><strong>Price:</strong> $149.90</p>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<h2>Vulcan language vi cheatsheet</h2>
|
||||
<p>learn vi and Vulcan at the same time</p>
|
||||
<p><strong>Price:</strong> $9.90</p>
|
||||
<p class="alert alert-warning">Nur noch wenige Exemplare verfügbar!</p>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<h2>Klingon language emacs cheatsheet</h2>
|
||||
<p>learn emacs and Klingon at the same time</p>
|
||||
<p><strong>Price:</strong> $9.90</p>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<h2>smartphone case with built-in screen</h2>
|
||||
<p>never miss a message</p>
|
||||
<p><strong>Price:</strong> $39.90</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
BIN
02_advanced/unterricht/tag20/02_zlib/data/products.html.gz
Normal file
BIN
02_advanced/unterricht/tag20/02_zlib/data/products.html.gz
Normal file
Binary file not shown.
16
02_advanced/unterricht/tag20/02_zlib/index.js
Normal file
16
02_advanced/unterricht/tag20/02_zlib/index.js
Normal file
@@ -0,0 +1,16 @@
|
||||
// const fs = require('node:fs');
|
||||
// const zlib = require('node:zlib');
|
||||
import fs from 'node:fs';
|
||||
import zlib from 'node:zlib';
|
||||
|
||||
const data = fs.readFileSync('data/products.html', 'utf-8');
|
||||
|
||||
const compressedData = zlib.gzipSync(data);
|
||||
console.log(compressedData); // => <Buffer 1f 8b 08 00 00 00 00 00 00 13 ad 96 cd 8e 1b 37 0c c7 ef 79 0a 66 d0 43 0b 64 ac 64 d3 00 d9 60 c6 28 d0 a6 97 16 c5 02 6d 7a a7 25 7a c4 56 a2 06 12 ... 701 more bytes>
|
||||
|
||||
try {
|
||||
fs.writeFileSync('data/products.html.gz', compressedData);
|
||||
console.log('compressed file');
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
13
02_advanced/unterricht/tag20/02_zlib/package.json
Normal file
13
02_advanced/unterricht/tag20/02_zlib/package.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "02_zlib",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"type": "module"
|
||||
}
|
||||
8769
02_advanced/unterricht/tag20/03_stream/data/products.html
Normal file
8769
02_advanced/unterricht/tag20/03_stream/data/products.html
Normal file
File diff suppressed because it is too large
Load Diff
BIN
02_advanced/unterricht/tag20/03_stream/data/products.html.gz
Normal file
BIN
02_advanced/unterricht/tag20/03_stream/data/products.html.gz
Normal file
Binary file not shown.
16
02_advanced/unterricht/tag20/03_stream/index.js
Normal file
16
02_advanced/unterricht/tag20/03_stream/index.js
Normal file
@@ -0,0 +1,16 @@
|
||||
// const fs = require('node:fs');
|
||||
// const zlib = require('node:zlib');
|
||||
import fs from 'node:fs';
|
||||
import zlib from 'node:zlib';
|
||||
|
||||
const gzipCompressor = zlib.createGzip();
|
||||
|
||||
const inputStream = fs.createReadStream('data/products.html');
|
||||
const outputStream = fs.createWriteStream('data/products.html.gz');
|
||||
|
||||
inputStream.on('data', (data) => {
|
||||
console.log('Pakete (data chunks) werden geladen: ', data.length);
|
||||
//outputStream.write(zlib.gzipSync(data));
|
||||
});
|
||||
|
||||
inputStream.pipe(gzipCompressor).pipe(outputStream);
|
||||
13
02_advanced/unterricht/tag20/03_stream/package.json
Normal file
13
02_advanced/unterricht/tag20/03_stream/package.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "03_stream",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"type": "module"
|
||||
}
|
||||
8
02_advanced/unterricht/tag20/04_crypto/index.js
Normal file
8
02_advanced/unterricht/tag20/04_crypto/index.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import crypto from 'node:crypto';
|
||||
|
||||
const data = 'Ich werde verschlüsselt!';
|
||||
const hash = crypto.createHash('sha256').update(data).digest('hex'); // 256-bit SHA-2 hash algorithm
|
||||
|
||||
console.log(hash); // 4803bce8b78d10b6bae3224c041f7c7311dedc056386870e50e6b56a109f4ee8
|
||||
|
||||
// https://cryptojs.gitbook.io/docs
|
||||
13
02_advanced/unterricht/tag20/04_crypto/package.json
Normal file
13
02_advanced/unterricht/tag20/04_crypto/package.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "04_crypto",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"type": "module"
|
||||
}
|
||||
12
02_advanced/unterricht/tag20/05_import-vs-require/common.js
Normal file
12
02_advanced/unterricht/tag20/05_import-vs-require/common.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const fs = require('node:fs'); // commonjs
|
||||
|
||||
if (true) {
|
||||
// in code Blöcken ({}) kann require (commonjs) verwendet werden.
|
||||
const dns = require('node:dns');
|
||||
dns.lookup('www.google.de', 4, (err, data) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
}
|
||||
console.log(data);
|
||||
});
|
||||
}
|
||||
15
02_advanced/unterricht/tag20/05_import-vs-require/esm.mjs
Normal file
15
02_advanced/unterricht/tag20/05_import-vs-require/esm.mjs
Normal file
@@ -0,0 +1,15 @@
|
||||
import fs from 'node:fs'; // module
|
||||
|
||||
if (true) {
|
||||
// in code Blöcken ({}) kann require (commonjs) verwendet werden.
|
||||
// import dns from 'node:dns';
|
||||
// seit 2020 dynamic imporrt
|
||||
import('node:dns').then((dns) => {
|
||||
dns.lookup('www.google.de', 4, (err, data) => {
|
||||
if (err) {
|
||||
console.log(err);
|
||||
}
|
||||
console.log(data);
|
||||
});
|
||||
});
|
||||
}
|
||||
17
02_advanced/unterricht/tag20/06_npm-befehle/index.js
Normal file
17
02_advanced/unterricht/tag20/06_npm-befehle/index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import express from 'express';
|
||||
import color from 'chalk';
|
||||
|
||||
const app = express();
|
||||
|
||||
const PORT = 3000;
|
||||
const HOST = '127.0.0.1'; // 'localhost'
|
||||
const BASE_URL = `http://${HOST}:${PORT}`;
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.send('Hello from Server');
|
||||
});
|
||||
|
||||
app.listen(PORT, HOST, () => {
|
||||
console.log(color.magenta(`🚀 Server is running at: ${BASE_URL}`));
|
||||
console.log(color.yellow('CTRL + C to close.'));
|
||||
});
|
||||
874
02_advanced/unterricht/tag20/06_npm-befehle/package-lock.json
generated
Normal file
874
02_advanced/unterricht/tag20/06_npm-befehle/package-lock.json
generated
Normal file
@@ -0,0 +1,874 @@
|
||||
{
|
||||
"name": "06_npm-befehle",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "06_npm-befehle",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"chalk": "^5.6.2",
|
||||
"express": "^5.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/accepts": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
|
||||
"integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-types": "^3.0.0",
|
||||
"negotiator": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz",
|
||||
"integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "^3.1.2",
|
||||
"content-type": "^2.0.0",
|
||||
"debug": "^4.4.3",
|
||||
"http-errors": "^2.0.1",
|
||||
"iconv-lite": "^0.7.2",
|
||||
"on-finished": "^2.4.1",
|
||||
"qs": "^6.15.2",
|
||||
"raw-body": "^3.0.2",
|
||||
"type-is": "^2.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/body-parser/node_modules/content-type": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz",
|
||||
"integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/bytes": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
|
||||
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind-apply-helpers": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bound": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
|
||||
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"get-intrinsic": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "5.6.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
|
||||
"integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^12.17.0 || ^14.13 || >=16.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/content-disposition": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz",
|
||||
"integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/content-type": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
|
||||
"integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/cookie": {
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
|
||||
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/cookie-signature": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz",
|
||||
"integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.4.3",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
|
||||
"integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/depd": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
|
||||
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/dunder-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"gopd": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/ee-first": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/encodeurl": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
|
||||
"integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/es-define-property": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-errors": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
||||
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-object-atoms": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz",
|
||||
"integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/escape-html": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
||||
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/etag": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
||||
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/express": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
|
||||
"integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"accepts": "^2.0.0",
|
||||
"body-parser": "^2.2.1",
|
||||
"content-disposition": "^1.0.0",
|
||||
"content-type": "^1.0.5",
|
||||
"cookie": "^0.7.1",
|
||||
"cookie-signature": "^1.2.1",
|
||||
"debug": "^4.4.0",
|
||||
"depd": "^2.0.0",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"etag": "^1.8.1",
|
||||
"finalhandler": "^2.1.0",
|
||||
"fresh": "^2.0.0",
|
||||
"http-errors": "^2.0.0",
|
||||
"merge-descriptors": "^2.0.0",
|
||||
"mime-types": "^3.0.0",
|
||||
"on-finished": "^2.4.1",
|
||||
"once": "^1.4.0",
|
||||
"parseurl": "^1.3.3",
|
||||
"proxy-addr": "^2.0.7",
|
||||
"qs": "^6.14.0",
|
||||
"range-parser": "^1.2.1",
|
||||
"router": "^2.2.0",
|
||||
"send": "^1.1.0",
|
||||
"serve-static": "^2.2.0",
|
||||
"statuses": "^2.0.1",
|
||||
"type-is": "^2.0.1",
|
||||
"vary": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/finalhandler": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",
|
||||
"integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.4.0",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"parseurl": "^1.3.3",
|
||||
"statuses": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/forwarded": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
||||
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/fresh": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",
|
||||
"integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"es-define-property": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"es-object-atoms": "^1.1.1",
|
||||
"function-bind": "^1.1.2",
|
||||
"get-proto": "^1.0.1",
|
||||
"gopd": "^1.2.0",
|
||||
"has-symbols": "^1.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"math-intrinsics": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dunder-proto": "^1.0.1",
|
||||
"es-object-atoms": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/gopd": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
||||
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/has-symbols": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/hasown": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",
|
||||
"integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/http-errors": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
|
||||
"integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"depd": "~2.0.0",
|
||||
"inherits": "~2.0.4",
|
||||
"setprototypeof": "~1.2.0",
|
||||
"statuses": "~2.0.2",
|
||||
"toidentifier": "~1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.7.3",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz",
|
||||
"integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/ipaddr.js": {
|
||||
"version": "1.9.1",
|
||||
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
||||
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/is-promise": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
|
||||
"integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/math-intrinsics": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/media-typer": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",
|
||||
"integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/merge-descriptors": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
|
||||
"integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.54.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
|
||||
"integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz",
|
||||
"integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mime-db": "^1.54.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/negotiator": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",
|
||||
"integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.4",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
|
||||
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/on-finished": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
|
||||
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ee-first": "1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/parseurl": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
||||
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "8.4.2",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz",
|
||||
"integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-addr": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"forwarded": "0.2.0",
|
||||
"ipaddr.js": "1.9.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.15.3",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz",
|
||||
"integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"es-define-property": "^1.0.1",
|
||||
"side-channel": "^1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/range-parser": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz",
|
||||
"integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/raw-body": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz",
|
||||
"integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "~3.1.2",
|
||||
"http-errors": "~2.0.1",
|
||||
"iconv-lite": "~0.7.0",
|
||||
"unpipe": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/router": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",
|
||||
"integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.4.0",
|
||||
"depd": "^2.0.0",
|
||||
"is-promise": "^4.0.0",
|
||||
"parseurl": "^1.3.3",
|
||||
"path-to-regexp": "^8.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/send": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz",
|
||||
"integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "^4.4.3",
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"etag": "^1.8.1",
|
||||
"fresh": "^2.0.0",
|
||||
"http-errors": "^2.0.1",
|
||||
"mime-types": "^3.0.2",
|
||||
"ms": "^2.1.3",
|
||||
"on-finished": "^2.4.1",
|
||||
"range-parser": "^1.2.1",
|
||||
"statuses": "^2.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/serve-static": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz",
|
||||
"integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"parseurl": "^1.3.3",
|
||||
"send": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/setprototypeof": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
||||
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz",
|
||||
"integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.4",
|
||||
"side-channel-list": "^1.0.1",
|
||||
"side-channel-map": "^1.0.1",
|
||||
"side-channel-weakmap": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-list": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",
|
||||
"integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-map": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
|
||||
"integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-weakmap": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
|
||||
"integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3",
|
||||
"side-channel-map": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/statuses": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
|
||||
"integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/toidentifier": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/type-is": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz",
|
||||
"integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"content-type": "^2.0.0",
|
||||
"media-typer": "^1.1.0",
|
||||
"mime-types": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/type-is/node_modules/content-type": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz",
|
||||
"integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/unpipe": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
||||
"integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
|
||||
"license": "ISC"
|
||||
}
|
||||
}
|
||||
}
|
||||
16
02_advanced/unterricht/tag20/06_npm-befehle/package.json
Normal file
16
02_advanced/unterricht/tag20/06_npm-befehle/package.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "06_npm-befehle",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"server": "npx http-server -c-1 -p 3000"
|
||||
},
|
||||
"keywords": [],
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"chalk": "^5.6.2",
|
||||
"express": "^5.2.1"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user