Skip to content

Instantly share code, notes, and snippets.

@christophemarois
Created August 9, 2023 14:15
Show Gist options
  • Save christophemarois/4185442371dffc118e6225405eee5446 to your computer and use it in GitHub Desktop.
Save christophemarois/4185442371dffc118e6225405eee5446 to your computer and use it in GitHub Desktop.
Native parsing for CLI args in node
import { parseArgs } from 'node:util'
const args = parseArgs({
options: { env: { type: 'string' }, dryRun: { type: 'boolean' } },
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment