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

const data = ['apple', 'banana', 'cherry'];
const readableStream = new Readable({
  read() {
    const item = data.shift();
    if (item == null) {
      this.push(null);
    } else {
      this.push(item);
    }
  }
});

readableStream.on('data', (chunk) => {
  console.log(chunk.toString());
});

