Slide 12
Slide 12 text
Stream
// error propagate ͕໘ͳΒ͜͏ॻ͚ͨΓ͢Δɻ
const { pipeline } = require('stream');
pipeline(
readableStream,
transformStream,
writableStream,
(err) => {
if (err) {
console.error('Pipeline failed.', err);
} else {
console.log('Pipeline succeeded.');
}
},
); // ͜ΕΛ promisify ͢Ε async/await Ͱॻ͚ͨΓ͢Δɻ