A nodejs question, really need some help here

23 views
Skip to first unread message

顾培

unread,
Aug 29, 2016, 2:04:53 AM8/29/16
to nodejs
 * Implement the below function, which takes a node stream, writes the output to
 * the file in 'path', and returns a promise which resolves when the stream is
 * exhausted and all data is successfully written to the file system.
 *
 * To write to the file system, use `fs-promise`, which provides promise wrappers
 * around things like `fs.writeFile()`. Do _not_ use `fs.createWriteStream()`.
 *
 * @param {Stream} stream a streams3-compatible stream, not in object mode
 * @param {String} filePath
 * @return {Promise} resolves when all data successfully written, rejects if any error
 */

function writeStreamToFile(stream, filePath)
Reply all
Reply to author
Forward
0 new messages