Skip to content

How to use Readline? #5

@williamrjribeiro

Description

@williamrjribeiro

Hi there,

I just started learning ReScript and I would like to use it for a NodeJS application. I'm trying to port this piece of NodeJS code to ReScript using rescript-nodejs but I can't find a way to use Readline module:

const fs = require('fs');
const readline = require('readline');

const rl = readline.createInterface({
  input: fs.createReadStream('sample.txt'),
  crlfDelay: Infinity
});

rl.on('line', (line) => {
  console.log(`Line from file: ${line}`);
});

I couldn't find any documentation on Readline module. Can you give me some hints? I just want to read a text file line by line.

If this is not the right place, where should I ask this kind of question?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions