pkgjs/parseargs

parseArgs in non-Node.js runtimes

shadowspawn opened this issue · 0 comments

Fun to see parseArgs appearing in other runtimes as they expand node compatibility.

// parseargs.ts
import { parseArgs } from 'node:util';
console.log(parseArgs({ strict: false }));
% bun run parseargs.ts --beep first second
{
  values: {
    beep: true,
  },
  positionals: [ "first", "second" ],
}
% deno run parseargs.ts --beep first second
{
  values: [Object: null prototype] { beep: true },
  positionals: [ "first", "second" ]
}