Skip to content

Get access to raw cli argument string #31145

@mik-jozef

Description

@mik-jozef

Is your feature request related to a problem? Please describe.
I'm working on my own programming language, and I'd like to be able to create
an interpreter in node.js that would accept this input:

node my-interpreter.mjs eval "Two times " ++ Pi ++ " equals " ++ (2 * Pi)
> Two times 3.14159 equals 6.28319

Anything beyond node my-interpreter.mjs eval is code written in my programming
language. I need this input in raw form to be able to parse the code. It is not possible
to reconstruct the code from process.argv.

Describe the solution you'd like
A string property like rawArgv on process variable.

Describe alternatives you've considered
It would be possible to put the whole code in quotes and escape all quotes in the code, but in my view this would make the command-line "API" much uglier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions