Browser JS argument parser


I am making a js CLI emulator and i need a command parser that will be able to parse arguments that are surronded with “” so what i need it to do if the in put is help "test command" to return['help', 'test command'] and NOT ['help', '"test', 'command"']

Repl link:

1 Like

can’t you just do like split the string by " " and then join the rest of the string together??


hmm the only problem i see is escaped " but i dont think i will run into thoose to much


ye also sometimes you will need the " specifications just to parse if it’s an int or not. That’s basically the job of the cli package so yeah… Also, please mark my thing as solved


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.