▲ | alex_duf 9 hours ago | ||||||||||||||||||||||||||||||||||||||||
Have you tried claude? https://claude.ai/public/artifacts/9c2d8d0c-0410-4971-a19a-f... node script.js --name=John --age 30 -v Parsed options: { name: 'John', age: 30, verbose: true, help: false } Positional arguments: [] node script.js --name=Alex --age 40 -v Parsed options: { name: 'Alex', age: 40, verbose: true, help: false } Positional arguments: [] | |||||||||||||||||||||||||||||||||||||||||
▲ | sebstefan 9 hours ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||
I keep seeing that `args = process.argv.slice(2)` line to skip past `node script.js` I ended up settling for it as well (I couldn't find anything better, nor make it break) but I'd be really surprised if it was the way to go Like `node --enable-tracing script.js --name=John --age 30 --verbose` This works because node seems to hide --enable-tracing to the underlying script But would it work with Bun & Deno...? Is that standard...? | |||||||||||||||||||||||||||||||||||||||||
▲ | sebstefan 9 hours ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||
This one seems way better It didn't account for the presence of a '--' to end the parsing of named arguments but that's it | |||||||||||||||||||||||||||||||||||||||||
|