Last active
June 5, 2022 06:17
-
-
Save simonplend/704484069bd6ad32b66712ccfe5d2ec4 to your computer and use it in GitHub Desktop.
Example using new experimental Node.js parseArgs method (https://nodejs.org/api/util.html#utilparseargsconfig) - more new features covered at https://github.com/simonplend/whats-new-in-node-js-core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { parseArgs } from "node:util"; | |
const args = parseArgs({ | |
options: { | |
name: { | |
type: "string", | |
}, | |
verbose: { | |
type: "boolean", | |
short: "v", | |
}, | |
}, | |
allowPositionals: true, | |
}); | |
console.log(args); |
Can't believe it has taken this long! Curious how long this will be an experimental
flag
Cool stuff!
Nice!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice