UpTest > Web Development > Node.js Test

Test: Node.js Test

Question 1: Prev Next Hide answers
Which of the following will copy a file in Node.js?
var fs = require('fs');
fs.createReadStream('test.file').pipe(fs.createWriteStream('newFile.file'));
1 votes
var fs = require('fs');
fs.createReadBuffer('test.file').pipe(fs.createWriteBuffer('newFile.file'));
0 votes
var fs = require('file');
fs.createFileReader('test.file').pipe(fs.createFileWriter('newFile.file'));
0 votes
var fs = require('fs');
fs.createReadBuffer('test.file').stream(fs.createWriteBuffer('newFile.file'));
0 votes
Please login to submit your answer.