Skip to content

Feature request: Inform the "line" event on a Readline interface of the type of end-of-line input #7952

@loilo

Description

@loilo

I was using the Readline module to rewrite a file line by line. While doing that I noticed that I had no idea which end-of-line (\r, \n, \r\n) caused the line break so I could not reassemble the file exactly as it was.

Of course I could detect the first EOL and then just use that for everything but in most cases I want to leave the line untouched anyway. Wouldn't it be a good idea to pass the found EOL string as a second argument to the callback of a line event emitted by a readline.Interface?

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.readlineIssues and PRs related to the built-in readline module.stale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions