Node Modules CLI and Library

1.0.1 · abandoned · verified Tue Apr 21

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.

Common errors

Warnings

Install

Imports

Quickstart

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.');
  }
});

view raw JSON →