Skip to content

Instantly share code, notes, and snippets.

@nairihar
Created September 26, 2022 18:01
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 nairihar/6cac9a5a2d1368ad1a14997fab7b0741 to your computer and use it in GitHub Desktop.
Save nairihar/6cac9a5a2d1368ad1a14997fab7b0741 to your computer and use it in GitHub Desktop.
Three ways to work with File System in Node.js | Sync functions
const fs = require('fs');
const data = fs.readFileSync('LICENSE.md');
try {
fs.writeFileSync('README.md', 'This is awesome!');
} catch (err) {
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment