Registry / web-framework / node-modules

node-modules

JSON →
library1.0.1jsnpmunverified

The `node-modules` package provides both a command-line interface (CLI) tool and a Node.js module for searching `node-modules.com`. Its primary functionality involves querying the site for packages, with an option to personalize results based on GitHub follows or stars. The current stable version is 1.0.1. Given its age and reliance on `node-modules.com` (which is no longer a primary source for package discovery, superseded by npmjs.com), the package has likely ceased active development. It does not appear to follow a regular release cadence and is designed for an ecosystem context that has largely evolved, making its key differentiator (integration with `node-modules.com`) less relevant today.

npm install node-modules
INSTALL
IMPORT
SIG · NODE-MODULES
N
node-modules
web-frameworkjavascriptv1.0.1
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.

search
const search = require('node-modules');
import search from 'node-modules';
This package is CommonJS-only, as indicated by its `require` usage in examples and its age (version 1.0.1). Attempting to use ES Modules `import` will result in a `ReferenceError` or similar module resolution error in most modern Node.js environments without a CommonJS wrapper.
NodeModulesCLI
require('node-modules/cli'); // or similar for programmatic CLI access
import { NodeModulesCLI } from 'node-modules';
While the package offers CLI functionality, the main module export is a search function. Direct programmatic access to the CLI logic (e.g., parsing arguments, invoking commands) is not explicitly exposed via named exports in the primary `node-modules` entry point. Users typically interact with the CLI via `node-modules <command>` in the terminal.
stream
search('query').on('data', handler);
const { stream } = require('node-modules');
The `search` function returns a readable stream directly, not an object with a `stream` property. The common pattern is to call `search()` and then attach event listeners to the returned stream for 'data' and 'end'.

Demonstrates how to use the `node-modules` library to perform a search and process the streamed results, including basic error handling.

const search = require('node-modules'); // Search for 'test framework' packages // Replace 'mafintosh' with your GitHub username if personalizing. const stream = search('test framework', { username: 'mafintosh' }); console.log('Searching for packages...'); stream.on('data', function(result) { // result is an object containing package information console.log(`- ${result.name} (v${result.version || 'N/A'}): ${result.description || 'No description'}`); }); stream.on('end', function() { console.log('--- Search complete. No more results. ---'); }); stream.on('error', function(err) { console.error('An error occurred during search:', err.message); if (err.message.includes('ECONNREFUSED') || err.message.includes('ENOTFOUND')) { console.error('This might be due to node-modules.com being unavailable or unreachable.'); } });
Debug
Known issues
breakingThe package relies on the `node-modules.com` website for search functionality. As of current information, this website is either defunct or no longer actively maintained, making the core functionality of this package effectively broken.
fix
There is no direct fix for the unavailability of the backend service. Users should consider alternative package search tools like `npm search` or directly browsing `npmjs.com`.
affects: >=1.0.0
gotchaThe `node-modules` package is written exclusively in CommonJS (CJS) and does not natively support ES Modules (ESM) syntax. Attempting to `import` it in an ESM context will lead to module resolution errors.
fix
For use in CJS environments, use `const search = require('node-modules');`. In ESM environments, a dynamic `import()` or a CJS wrapper might be necessary: `const search = await import('node-modules').then(m => m.default || m);` (though `m.default` is unlikely for this package, it's good practice for others).
affects: >=1.0.0
gotchaThe package has not been updated since 2014, meaning it may contain outdated dependencies or security vulnerabilities, and is unlikely to receive patches for newly discovered issues.
fix
Due to its abandoned status, it's recommended to avoid using this package for new projects. For existing projects, perform a security audit of its dependencies (e.g., `npm audit`) and consider migrating to actively maintained alternatives.
affects: >=1.0.0
Errors
Common errors & fixes
node-modules: command not found
The `node-modules` CLI tool was not installed globally or is not in your system's PATH.
fix
Install the package globally using `npm install -g node-modules`.
ReferenceError: require is not defined in ES module scope
Attempting to use `require('node-modules')` inside an ES Module (ESM) file (e.g., a `.mjs` file or a `.js` file in a `"type": "module"` project).
fix
Use `const search = await import('node-modules');` or convert your file to CommonJS. However, given the package's design, using it in modern ESM projects is generally discouraged.
Error: connect ECONNREFUSED <ip-address>:<port>
The `node-modules` package tried to connect to `node-modules.com` but the connection was refused. This typically indicates the server is offline, unreachable, or has been shut down.
fix
This issue is inherent to the dependency on a potentially defunct external service. There is no code-level fix for this specific package. You must use alternative package discovery methods.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
node-modules — npm install node-modules · libregistry