const { Writable } = require('stream');

const writableStream = new Writable({
  write(chunk, encoding, callback) {
    console.log(chunk.toString());
    callback();
  }
});

writableStream.write('maths\n');
writableStream.write('history\n');
writableStream.write('psychology\n');
