How can I parse a string into appropriate arguments for child_process.spawn?
问题 I want to be able to take a command string, for example: some/script --option="Quoted Option" -d --another-option 'Quoted Argument' And parse it into something that I can send to child_process.spawn : spawn("some/script", ["--option=\"Quoted Option\"", "-d", "--another-option", "Quoted Argument"]) All of the parsing libraries I've found (e.g. minimist, etc.) do too much here by parsing it into some kind of options object, etc. I basically want the equivalent of whatever Node does to create