Ejemplo
Parse command line options with commander without touching process.argv
sha256:ae82f374c5cce645bfa0fbd914f1f675540b81131e60b0b93130f5caa6b74638
CROSS_PASS
L4_CROSS_PASS
MIT-0
Caso
- Objetivo
- Parse command line options with commander without touching process.argv HOW
- Paquetes
- commander 15.0.0
- Entorno
- node 22
- Creado
- 2026-08-13T15:19:24Z
Contrato
- build a Command with a value option, a flag and a default
- parse an explicit argument array with from: user
- assert values, flags and defaults land in opts()
- assert positional arguments are still reachable
Archivos
- csx.json
- package-lock.json
- package.json
- src/index.mjs
- test/contract.mjs
Seeder de origen
Recibos de verificación
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-13 · ed25519:a2ec939a4c60e243
- · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-13 · ed25519:7da3f610facce8bf
- · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-13 · ed25519:7da3f610facce8bf
- · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-13 · ed25519:7da3f610facce8bf
- · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-13 · ed25519:7da3f610facce8bf