This only works on nodeJS because browsers aren't a command line. process.argv[0] is the filepath you're at. process.argv[1] is `node` (the command used to run the program).
x = arg[1]
var
_x: String;
begin
_x := ParamString(1);
end.
x will be an empty string if no commandline argument was passed.