{"id":13104,"library":"ee-argv","title":"ee-argv: Simple Command-Line Argument Parser","description":"ee-argv is a minimalist command-line argument parser for Node.js, designed for straightforward key-value and flag parsing. It supports `--key=value`, `--key`, and `--key value` argument formats, offering basic `has(key)` and `get(key)` methods to access parsed arguments. Currently at version 1.0.2, the package appears to be unmaintained, with its `package.json` indicating compatibility with Node.js `>=4.2.1`, an environment released in 2015. Unlike modern CLI parsing libraries such as `yargs` or `commander.js`, ee-argv lacks advanced features like type validation, subcommand support, automatic help generation, or robust error handling, making it suitable only for very simple, legacy Node.js applications or as a direct replacement for manual `process.argv` parsing. There is no discernible release cadence due to its inactive status.","status":"abandoned","version":"1.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/eventEmitter/ee-argv","tags":["javascript","argv","commandline","parser"],"install":[{"cmd":"npm install ee-argv","lang":"bash","label":"npm"},{"cmd":"yarn add ee-argv","lang":"bash","label":"yarn"},{"cmd":"pnpm add ee-argv","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is CommonJS-only and relies on `require()`. Attempting to use named ESM `import` will fail, as there are no named exports.","wrong":"import { argv } from 'ee-argv';","symbol":"argv","correct":"const argv = require('ee-argv');"},{"note":"While CommonJS modules can sometimes be imported in ESM contexts via a default import, the `argv` object itself would be the `module.exports` value. Direct named imports are not supported.","symbol":"argv","correct":"import argv from 'ee-argv'; // In an ESM context, this imports the entire module.exports object."},{"note":"The package exports a single object (the `argv` instance), so methods like `get` or `has` must be accessed as properties of the imported `argv` object, not as direct named exports.","wrong":"const { get } = require('ee-argv'); // No direct named export for methods","symbol":"argv.get","correct":"const argv = require('ee-argv');\nconst port = argv.get('port');"}],"quickstart":{"code":"const argv = require(\"ee-argv\");\n\n// Simulate command-line arguments for demonstration\n// In a real application, these would come from process.argv\nconst simulatedArgs = [\n  \"node\",\n  \".\",\n  \"--port=2345\",\n  \"--trace-http-request\",\n  \"--debug\",\n  \"sql queries\",\n  \"--host\",\n  \"localhost\"\n];\n\n// Temporarily override process.argv for testing\nconst originalArgv = process.argv;\nprocess.argv = simulatedArgs;\n\n// Initialize argv parser\nconst parsedArgv = require(\"ee-argv\");\n\nconsole.log(\"Does it have 'trace-http-request'?\", parsedArgv.has(\"trace-http-request\"));\nconsole.log(\"Value for 'port':\", parsedArgv.get(\"port\"));\nconsole.log(\"Does it have 'port'?\", parsedArgv.has(\"port\"));\nconsole.log(\"Value for 'debug':\", parsedArgv.get(\"debug\"));\nconsole.log(\"Value for 'host':\", parsedArgv.get(\"host\"));\n\n// Restore original process.argv\nprocess.argv = originalArgv;","lang":"javascript","description":"Demonstrates basic usage of ee-argv to parse simulated command-line arguments using `has()` and `get()` methods."},"warnings":[{"fix":"For ESM projects, consider using dynamic `import('ee-argv')` if absolutely necessary, but be aware of the default import caveat. The recommended fix is to migrate to a modern CLI argument parser that supports ESM, such as `yargs` or `commander.js`.","message":"The `ee-argv` package is CommonJS-only and does not natively support ES Modules (ESM). Attempting to `import` it in an ESM context will lead to runtime errors or unexpected behavior, as it was designed for older Node.js versions.","severity":"breaking","affected_versions":"All versions"},{"fix":"Avoid using in new projects. For existing projects, consider migrating to a actively maintained CLI parsing library. If continued use is unavoidable, thoroughly audit the codebase for potential security flaws.","message":"The package is unmaintained and its last activity dates back to a Node.js 4.x era. This means it will not receive updates for new Node.js features, bug fixes, or security vulnerabilities, posing a potential risk for production environments.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Evaluate if the project's needs exceed simple flag/key-value parsing. For more robust command-line interfaces, switch to feature-rich alternatives like `yargs`, `commander.js`, or `minimist` for more granular control.","message":"`ee-argv` offers very basic argument parsing. It does not provide features common in modern CLI tools like type validation, default values, array arguments, aliases, subcommands, or automatic help message generation. This can lead to brittle CLI interfaces or requires significant boilerplate code.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Refactor your project to use CommonJS modules for files importing `ee-argv`, or switch to a modern argument parser that supports ESM. If you must use `ee-argv` in an ESM context, consider `const argv = await import('ee-argv');` and be aware it might not behave as expected for all features.","cause":"Attempting to use `require('ee-argv')` in an ECMAScript Module (ESM) file (e.g., a `.mjs` file or a `.js` file in a package with `\"type\": \"module\"`).","error":"ReferenceError: require is not defined"},{"fix":"Ensure that `const argv = require('ee-argv');` is used in a CommonJS context. If using ESM, verify that the default import correctly resolves to the module's `exports` object and that `argv.has` is being called on the correct object.","cause":"This typically occurs if the `ee-argv` module was not correctly imported, especially in an ESM context where `import argv from 'ee-argv'` might return the module wrapper instead of the direct `argv` object, or if `require()` somehow failed.","error":"TypeError: argv.has is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":""}