Skip to content

Instantly share code, notes, and snippets.

@HenriBeck
Created March 10, 2018 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HenriBeck/7eedbec84f1ed954401f85065c7250c3 to your computer and use it in GitHub Desktop.
Save HenriBeck/7eedbec84f1ed954401f85065c7250c3 to your computer and use it in GitHub Desktop.
Schreiben und Lesen von Dateien
// Importieren des FileSystem module
const fs = require('fs');
// Zum lesen einer Datei:
const datei = fs.readFileSync(pfad, 'utf-8');
// Zum schreiben in eine Datei:
// Hierbei wird die komplette Datei überschrieben!
fs.writeFileSync(pfad, neuerContent, 'utf-8');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment