{
 "kind": "tool",
 "slug": "argparse",
 "path": "tools/argparse/",
 "name": "argparse",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Dev workflow and config",
   "tools/dev-workflow/"
  ]
 ],
 "lead": "Python-style command options.",
 "chips": [
  {
   "label": "Dev workflow and config",
   "path": "tools/dev-workflow/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install argparse"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/nodeca/argparse"
  },
  {
   "label": "Website",
   "href": "https://github.com/nodeca/argparse#readme"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "PSF-2.0",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python alone or in any derivative version",
   "note": "Any use is allowed; keep the PSF copyright notice with the code.",
   "src": "https://github.com/nodeca/argparse/blob/master/LICENSE"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Oct 24, 2026",
   "note": "",
   "src": "https://github.com/nodeca/argparse"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "2 projects",
   "status": "info",
   "sub": "#217 of 299 in its category",
   "note": "Dependency in 2 public GitHub projects set up for AI coding agents that we scanned (0.0%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 11, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What argparse does",
   "parts": [
    {
     "t": "prose",
     "text": "This argparse is a free JavaScript library that reads the options typed after a command in Node.js programs. It copies the argparse module built into Python, so the help screen, error messages and option names work the same way. It is not Python's own module; it is the Node.js version of it."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Options for a build script",
       "text": "A script that builds your site takes --pages 120 or --dry-run, checks that numbers really are numbers and prints a help screen with -h.",
       "idea": false
      },
      {
       "title": "One tool with several commands",
       "text": "A small admin tool for your project has separate build and publish commands, each with its own options and help.",
       "idea": false
      },
      {
       "title": "Catch a typo in a command name",
       "text": "Someone types \"pubish\"; the tool answers \"maybe you meant 'publish'?\" instead of only an error.",
       "idea": false
      },
      {
       "title": "Bring a Python tool to Node.js",
       "text": "Your team has a Python script with argparse options; the Node.js version keeps the same option names and help text with few changes.",
       "idea": false
      },
      {
       "title": "Handle bad input inside your code",
       "text": "A tool that runs inside a bigger program catches a wrong value as an error object instead of quitting the whole process.",
       "idea": false
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "argparse popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "47",
       "of": "/ 100",
       "l": "Gid Score, #2277 overall"
      },
      {
       "n": "385M",
       "l": "downloads a week, npm"
      },
      {
       "n": "515",
       "l": "GitHub stars"
      },
      {
       "n": "2",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How argparse is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "argparse joined the catalog on its public numbers (384,858,248 downloads a week on npm and 515 GitHub stars), not on our project count: it is a dependency in 5 public GitHub projects of our scan, 2 of them set up for AI coding agents.",
      "The most used alternative in our scan is Commander (174 projects).",
      "Projects that use it most often also use dotenv (100.0%), glob (100.0%), cssnano (80.0%)."
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 100.0% of its projects",
       "v": "dotenv",
       "path": "tools/dotenv/"
      },
      {
       "l": "In 100.0% of its projects",
       "v": "glob",
       "path": "tools/glob/"
      },
      {
       "l": "In 80.0% of its projects",
       "v": "cssnano",
       "path": "tools/cssnano/"
      },
      {
       "l": "In 100.0% of its projects",
       "v": "ESLint",
       "path": "tools/eslint/"
      },
      {
       "l": "In 60.0% of its projects",
       "v": "ansi-escapes",
       "path": "tools/ansi-escapes/"
      },
      {
       "l": "In 60.0% of its projects",
       "v": "Browserslist",
       "path": "tools/browserslist/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about argparse",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/puzrin",
        "GitHub Sponsors: https://github.com/nodeca",
        "2 GitHub sponsors"
       ]
      },
      {
       "title": "More in Dev workflow and config",
       "path": "tools/dev-workflow/",
       "items": [
        {
         "text": "dotenv",
         "path": "tools/dotenv/"
        },
        {
         "text": "Husky",
         "path": "tools/husky/"
        },
        {
         "text": "python-dotenv",
         "path": "tools/python-dotenv/"
        },
        {
         "text": "lint-staged",
         "path": "tools/lint-staged/"
        },
        {
         "text": "concurrently",
         "path": "tools/concurrently/"
        },
        {
         "text": "Rich",
         "path": "tools/rich/"
        },
        {
         "text": "Pydantic Settings",
         "path": "tools/pydantic-settings/"
        },
        {
         "text": "cross-env",
         "path": "tools/cross-env/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "argparse",
       "me": true,
       "facts": [
        "PSF-2.0",
        "Gid 47",
        "385M/wk"
       ]
      },
      {
       "name": "Commander",
       "why": "Pick Commander for the most common Node.js way to describe commands and options, with chained method calls and many examples.",
       "path": "tools/commander/",
       "facts": [
        "MIT",
        "Gid 82",
        "788M/wk"
       ]
      },
      {
       "name": "yargs",
       "why": "Pick yargs when you want commands, help and validation described as one object, plus shell completion.",
       "path": "tools/yargs/",
       "facts": []
      },
      {
       "name": "minimist",
       "why": "Pick minimist when you only need to split --name value pairs into an object, with no help screen or checks.",
       "path": "tools/minimist/",
       "facts": []
      }
     ],
     "more": "Compare argparse with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Use the npm package argparse (pin argparse@3.0.4) to parse this Node.js script's options with snake_case names (add_argument, parse_args, store_true), string types like 'int', subcommands via add_subparsers, and suggest_on_error true; read the Python 3.14 argparse docs for details."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Read the Python argparse documentation for the options; this package has only notes on the differences.",
       "code": null,
       "src": "https://github.com/nodeca/argparse/blob/master/README.md"
      },
      {
       "text": "Pass options as one object instead of Python's keyword arguments.",
       "code": "new ArgumentParser({ description: 'example', add_help: true })",
       "src": "https://github.com/nodeca/argparse/blob/master/README.md"
      },
      {
       "text": "Name types as strings such as 'int', 'float' or 'str'.",
       "code": ".add_argument('-b', { type: 'int', help: 'help' })",
       "src": "https://github.com/nodeca/argparse/blob/master/README.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "parser.addArgument('--foo') and parser.parseArgs(), copied from argparse 1.x examples",
       "fix": "parser.add_argument('--foo') and parser.parse_args()",
       "why": "Version 3 removed the camelCase aliases; in our run on 3.0.4 both methods were undefined."
      },
      {
       "dont": "new ArgumentParser({ addHelp: false }) or { action: 'storeTrue' }",
       "fix": "new ArgumentParser({ add_help: false }) and { action: 'store_true' }",
       "why": "Old option and action names were removed; in our run addHelp threw \"got an unexpected keyword argument 'addHelp'\"."
      },
      {
       "dont": "parser.add_argument('--width', { type: Number }) or type: int as in Python",
       "fix": "parser.add_argument('--width', { type: 'int' })",
       "why": "JavaScript has no Python int type, so types are named with strings."
      },
      {
       "dont": "Reading args.dryRun after add_argument('--dry-run')",
       "fix": "Read args.dry_run (or set dest explicitly)",
       "why": "Dashes inside option names become underscores; our run printed {\"dry_run\":true}."
      },
      {
       "dont": "Expecting suggest_on_error on the main parser to also fix typos in a subcommand's choices",
       "fix": "Pass suggest_on_error true to each add_parser() call too",
       "why": "In our run the main parser suggested 'publish' for 'pubish', but the publish subcommand did not suggest 'production' for 'prodution' until its own parser had the option."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Is this Python's argparse?",
       "a": "No. It is a JavaScript copy of Python's module for Node.js, following Python 3.14.6.",
       "evidence": {
        "url": "https://github.com/nodeca/argparse/blob/master/README.md",
        "quote": "Port of python's argparse (version 3.14.6)."
       }
      },
      {
       "q": "Can I use it in a paid product?",
       "a": "Yes. The PSF-2.0 license allows any use; keep the copyright notice.",
       "evidence": {
        "url": "https://github.com/nodeca/argparse/blob/master/LICENSE",
        "quote": "PSF hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python alone or in any derivative version"
       }
      },
      {
       "q": "What changed in version 3?",
       "a": "It follows Python 3.14.6, adds colored help, typo suggestions and built-in TypeScript types, and drops the old camelCase names.",
       "evidence": {
        "url": "https://github.com/nodeca/argparse/blob/master/CHANGELOG.md",
        "quote": "Updated the Python argparse port from 3.9.0 to 3.14.6."
       }
      },
      {
       "q": "How does it behave on a wrong value?",
       "a": "It prints the usage line and an error and exits with code 2, unless exit_on_error is false; our run showed exit code 2.",
       "evidence": {
        "url": "https://docs.python.org/3.14/library/argparse.html",
        "quote": "Normally, when you pass an invalid argument list to the parse_args() method of an ArgumentParser , it will print a message to sys.stderr and exit with a status code of 2."
       }
      },
      {
       "q": "Is it still maintained?",
       "a": "Yes. Version 3.0.4 came out on 2026-10-24, after five years at 2.0.1.",
       "evidence": {
        "url": "https://github.com/nodeca/argparse/blob/master/CHANGELOG.md",
        "quote": "[3.0.4] - 2026-10-24"
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm argparse"
  ],
  [
   "Category",
   "Dev workflow and config"
  ],
  [
   "License",
   "PSF-2.0"
  ],
  [
   "Gid Score",
   "47.4"
  ],
  [
   "Rank in category",
   "#217 of 299"
  ],
  [
   "GitHub",
   "nodeca/argparse"
  ],
  [
   "Last change",
   "Oct 24, 2026"
  ]
 ],
 "good": [
  "There is no separate manual; you read Python's argparse pages and the list of differences.",
  "Version 3 removed the old camelCase method names that many older examples still use.",
  "Error messages are fixed English text; they cannot be translated."
 ],
 "checked_line": "Read by AgentGid from 8 official pages, card checked Nov 11, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/nodeca.png"
}