Registry / http-networking / ee-argv

ee-argv

JSON →
library1.0.2jsnpmunverified

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.

npm install ee-argv
INSTALL
IMPORT
SIG · EE-ARGV
E
ee-argv
http-networkingjavascriptv1.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

argv
const argv = require('ee-argv');
import { argv } from 'ee-argv';
This package is CommonJS-only and relies on `require()`. Attempting to use named ESM `import` will fail, as there are no named exports.
argv
import argv from 'ee-argv'; // In an ESM context, this imports the entire module.exports object.
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.
argv.get
const argv = require('ee-argv'); const port = argv.get('port');
const { get } = require('ee-argv'); // No direct named export for methods
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.

Demonstrates basic usage of ee-argv to parse simulated command-line arguments using `has()` and `get()` methods.

const argv = require("ee-argv"); // Simulate command-line arguments for demonstration // In a real application, these would come from process.argv const simulatedArgs = [ "node", ".", "--port=2345", "--trace-http-request", "--debug", "sql queries", "--host", "localhost" ]; // Temporarily override process.argv for testing const originalArgv = process.argv; process.argv = simulatedArgs; // Initialize argv parser const parsedArgv = require("ee-argv"); console.log("Does it have 'trace-http-request'?", parsedArgv.has("trace-http-request")); console.log("Value for 'port':", parsedArgv.get("port")); console.log("Does it have 'port'?", parsedArgv.has("port")); console.log("Value for 'debug':", parsedArgv.get("debug")); console.log("Value for 'host':", parsedArgv.get("host")); // Restore original process.argv process.argv = originalArgv;
Debug
Known issues
breakingThe `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.
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`.
affects: All versions
gotchaThe 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.
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.
affects: All versions
gotcha`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.
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.
affects: All versions
Errors
Common errors & fixes
ReferenceError: require is not defined
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"`).
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.
TypeError: argv.has is not a function
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.
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.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
ee-argv — npm install ee-argv · libregistry