const fs = require('fs'); // Create a folder fs.mkdirSync('myFolder'); // Create a text file fs.writeFileSync('myFolder/info.txt', 'Hello from Node.js'); // Create a JSON file fs.writeFileSync('myFolder/data.json', '{"name": "Amit"}'); // Create an HTML file fs.writeFileSync('myFolder/index.html', '<h1>Welcome</h1>');
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter