Skip to content

process.argv contains getter functions instead of strings #30964

@KnorpelSenf

Description

@KnorpelSenf

Version: Deno 2.5.4

On Node.js, the value of process.argv is a string array. On Deno, it is an array of getter functions.

Actual Behaviour

$ # Create a repro file
$ echo 'console.log(process.argv)' > main.ts
$ 
$ # Compare Node and Deno output
$ deno main.ts 
[ [Getter], [Getter] ]
$ node main.ts 
[
  '/home/steffen/.local/share/fnm/node-versions/v24.10.0/installation/bin/node',
  '/tmp/repro/main.ts'
]

Expected Behaviour

I would assume that both Node and Deno output a string array.

Note that it works well if you do console.log(...process.argv) as the getter functions are called implicitly with the spread operator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions