javascript
Published on January 26, 2024By DeveloperBreeze
// Import 'fs' module
const fs = require('fs');
// Create read and write streams
const readStream = fs.createReadStream('input.txt');
const writeStream = fs.createWriteStream('output.txt');
// Pipe data from read stream to write stream for file copy
readStream.pipe(writeStream);
Comments
Please log in to leave a comment.