{
 "kind": "tool",
 "slug": "yargs-parser",
 "path": "tools/yargs-parser/",
 "name": "yargs-parser",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Dev workflow and config",
   "tools/dev-workflow/"
  ]
 ],
 "lead": "Turn typed command options into values.",
 "chips": [
  {
   "label": "Dev workflow and config",
   "path": "tools/dev-workflow/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install yargs-parser"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/yargs/yargs-parser"
  },
  {
   "label": "Website",
   "href": "https://github.com/yargs/yargs-parser#readme"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "ISC",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.",
   "note": "Any use, with or without a fee, is allowed under ISC.",
   "src": "https://github.com/yargs/yargs-parser/blob/main/LICENSE.txt"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change today",
   "note": "Latest GitHub release May 26, 2025. ",
   "src": "https://github.com/yargs/yargs-parser"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "3 projects",
   "status": "info",
   "sub": "#192 of 299 in its category",
   "note": "Dependency in 3 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 10, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What yargs-parser does",
   "parts": [
    {
     "t": "prose",
     "text": "yargs-parser is a small free JavaScript library that reads options typed after a command, like \"--width 1200 --dry-run\", and gives your code ready values. Numbers become numbers, on-off switches become true or false, and other words are kept in a list. It is the part of the yargs toolkit that only reads options; it does not print help or check for mistakes."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Options for your own script",
       "text": "You have a small Node.js script that resizes photos or cleans a folder. It reads \"-w 1200 --dry-run\" without you splitting the text by hand.",
       "idea": false
      },
      {
       "title": "Commands typed in a chat box",
       "text": "A team chat bot or a web console gets \"/deploy --env staging --force\" as one line of text and needs the parts as values.",
       "idea": false
      },
      {
       "title": "A command box in a web page",
       "text": "A tutorial site or an in-browser playground lets visitors type options, and the page reads them without a server.",
       "idea": false
      },
      {
       "title": "Quiet, normal or chatty output",
       "text": "Your tool prints more detail with -v and even more with -vvv; the library counts the letters for you.",
       "idea": false
      },
      {
       "title": "Pass extra words to another program",
       "text": "A wrapper script keeps everything after \"--\" untouched and hands it to the program it starts, like a test runner.",
       "idea": false
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "yargs-parser popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "48",
       "of": "/ 100",
       "l": "Gid Score, #2165 overall"
      },
      {
       "n": "394M",
       "l": "downloads a week, npm"
      },
      {
       "n": "520",
       "l": "GitHub stars"
      },
      {
       "n": "3",
       "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 yargs-parser is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "yargs-parser joined the catalog on its public numbers (394,038,993 downloads a week on npm and 520 GitHub stars), not on our project count: it is a dependency in 6 public GitHub projects of our scan, 3 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 tsx (66.7%), Prettier (66.7%), Vitest (66.7%)."
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 66.7% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 66.7% of its projects",
       "v": "Prettier",
       "path": "tools/prettier/"
      },
      {
       "l": "In 66.7% of its projects",
       "v": "Vitest",
       "path": "tools/vitest/"
      },
      {
       "l": "In 50.0% of its projects",
       "v": "js-yaml",
       "path": "tools/js-yaml/"
      },
      {
       "l": "In 50.0% of its projects",
       "v": "yaml",
       "path": "tools/yaml/"
      },
      {
       "l": "In 50.0% of its projects",
       "v": "yargs",
       "path": "tools/yargs/"
      },
      {
       "l": "In 83.3% of its projects",
       "v": "ESLint",
       "path": "tools/eslint/"
      },
      {
       "l": "In 66.7% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about yargs-parser",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/shadowspawn",
        "thanks.dev: https://thanks.dev/u/gh/shadowspawn",
        "Tidelift: https://tidelift.com/funding/github/npm/yargs-parser",
        "4 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": "yargs-parser",
       "me": true,
       "facts": [
        "ISC",
        "Gid 48",
        "394M/wk"
       ]
      },
      {
       "name": "yargs",
       "why": "Pick yargs when your tool needs automatic help and usage text, commands and checks, not only the raw values.",
       "path": "tools/yargs/",
       "facts": []
      },
      {
       "name": "Commander",
       "why": "Pick Commander for a complete command-line app with sub-commands and help with little setup.",
       "path": "tools/commander/",
       "facts": [
        "MIT",
        "Gid 82",
        "788M/wk"
       ]
      },
      {
       "name": "minimist",
       "why": "Pick minimist when you want an even smaller option reader with fewer settings.",
       "path": "tools/minimist/",
       "facts": []
      }
     ],
     "more": "Compare yargs-parser with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Use yargs-parser (pin yargs-parser@22.0.0, Node.js 20.19+ or 22.12+) to read the options of our script; declare number, boolean, array and string options and defaults, and turn greedy-arrays off if a list option comes before file names."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Add the package to your project.",
       "code": "npm i yargs-parser --save",
       "src": "https://github.com/yargs/yargs-parser/blob/main/README.md"
      },
      {
       "text": "Pass it the words after your command, or one string, and read the result.",
       "code": "const argv = require('yargs-parser')(process.argv.slice(2))\nconsole.log(argv)\n",
       "src": "https://github.com/yargs/yargs-parser/blob/main/README.md"
      },
      {
       "text": "Tell it which options are numbers, switches, lists or text, and give defaults.",
       "code": "import parser from 'yargs-parser'\n\nconst argv = parser('--foo=99 --bar=9987930', {\n  string: ['bar']\n})\n",
       "src": "https://github.com/yargs/yargs-parser/blob/main/README.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "require('yargs-parser') with yargs-parser 22 on Node.js 18 or 20.0-20.18",
       "fix": "Upgrade to Node.js 20.19+ or 22.12+, or pin yargs-parser@21.1.1 on older Node.js",
       "why": "Version 22 is published as an ES module only and lists those Node.js versions as its minimum."
      },
      {
       "dont": "array: ['format'] and then shrink --format webp avif photo.jpg",
       "fix": "Put files first, or set configuration: { 'greedy-arrays': false } so a list takes one word per flag",
       "why": "A list option keeps taking the following words; in our run photo.jpg ended up inside format."
      },
      {
       "dont": "Counting on it to reject unknown or misspelled options",
       "fix": "Check argv against your own list of allowed keys, or use yargs' strict mode for real validation",
       "why": "Unknown options are accepted as new keys; in our run --output-dir became outputDir with no error."
      },
      {
       "dont": "parse(['-f', 11, '--zoom', 55]) with numbers in the list",
       "fix": "parse(['-f', 11, '--zoom', 55].map(String)), or join the list into one string",
       "why": "The README asks for strings; convert mixed values before you pass them."
      },
      {
       "dont": "Reading parser(...) result only and missing that an option needed more words",
       "fix": "Use parser.detailed(args, opts) and check its error field",
       "why": "The plain call returns values only; detailed() also returns the error, as in our run with narg."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Does it print a --help screen?",
       "a": "No. It only turns the typed words into values; yargs, which is built on it, adds help and usage text.",
       "evidence": {
        "url": "https://github.com/yargs/yargs-parser/blob/main/README.md",
        "quote": "visit the yargs website for more examples, and thorough usage instructions."
       }
      },
      {
       "q": "Can I give it one string instead of a list of words?",
       "a": "Yes. It takes a string or a list of strings.",
       "evidence": {
        "url": "https://github.com/yargs/yargs-parser/blob/main/README.md",
        "quote": "args: a string or array of strings representing the options to parse."
       }
      },
      {
       "q": "Does --no-color work?",
       "a": "Yes. By default an option that starts with --no- is read as that option set to false.",
       "evidence": {
        "url": "https://github.com/yargs/yargs-parser/blob/main/README.md",
        "quote": "Should variables prefixed with --no be treated as negations?"
       }
      },
      {
       "q": "Does it work in the browser?",
       "a": "Yes, through its browser entry, since version 19. Loading settings from files is not supported there.",
       "evidence": {
        "url": "https://github.com/yargs/yargs-parser/blob/main/README.md",
        "quote": "As of v19 yargs-parser supports ESM"
       }
      },
      {
       "q": "Can I use it in a paid product?",
       "a": "Yes. The ISC license allows any use with or without a fee; keep the notice in copies.",
       "evidence": {
        "url": "https://github.com/yargs/yargs-parser/blob/main/LICENSE.txt",
        "quote": "Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies."
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm yargs-parser"
  ],
  [
   "Category",
   "Dev workflow and config"
  ],
  [
   "License",
   "ISC"
  ],
  [
   "Gid Score",
   "48.4"
  ],
  [
   "Rank in category",
   "#192 of 299"
  ],
  [
   "GitHub",
   "yargs/yargs-parser"
  ],
  [
   "Last change",
   "Nov 17, 2026"
  ]
 ],
 "good": [
  "It only reads options. Help text, required options and error messages for typos are in the full yargs package.",
  "An option you did not list is still accepted. In our run a misspelled \"--output-dir\" became a new value instead of an error.",
  "Version 22 needs Node.js 20.19 or 22.12 and newer; projects on older Node.js stay on version 21."
 ],
 "checked_line": "Read by AgentGid from 7 official pages, card checked Nov 10, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/yargs.png"
}