Skip to content

missing allowNegative option in parseArgs from node:util #28606

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
imcotton opened this issue Mar 24, 2025 · 1 comment · Fixed by #28811
Closed

missing allowNegative option in parseArgs from node:util #28606

imcotton opened this issue Mar 24, 2025 · 1 comment · Fixed by #28811
Labels

Comments

@imcotton
Copy link

@imcotton
Copy link
Author

snippet

import { parseArgs } from 'node:util';

const { values } = parseArgs({
    allowNegative: true,
    options: {
        color: { type: 'boolean' },
    },
    args: [ '--no-color' ],
});

console.log(values);

Node.js v22

{ color: false }

Deno v2.2.5

error: Uncaught (in promise) TypeError: Unknown option '--no-color'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants