Overview
This node performs a search for NPM packages using AI-powered relevance scoring. It is useful for finding Node.js packages based on a search term, retrieving details such as package name, version, description, keywords, author, publisher, maintainers, links, and relevance scores. Practical applications include discovering new packages for development, comparing package options, and exploring package metadata.
Use Case Examples
- Searching for packages related to 'express' to find web server frameworks.
- Finding the most relevant packages for a specific functionality like 'authentication'.
- Retrieving package details and relevance scores to decide which package to use in a project.
Output
JSON
tools- ``
*name- Name of the tool (e.g., 'npm_search')
*description- Description of the tool's purpose
*schema
*properties
*searchQuery- The search term to look for in NPM packages
*size- Number of results to return (optional, default 20)
*from- Offset for pagination (optional, default 0)
*function- Function performing the NPM search and returning results
- ``
json- The JSON output contains an array of NPM package search results with details such as name, version, description, keywords, author, publisher, maintainers, links, and relevance scores including AI relevance score
Dependencies
- Uses axios for HTTP requests to the NPM registry API
Troubleshooting
- Common issue: Network errors or failure to reach the NPM registry. Resolution: Check internet connection and NPM registry availability.
- Error message 'Failed to search NPM' indicates an issue with the API request. Resolution: Verify the search query and parameters, and ensure the NPM registry endpoint is accessible.
Links
- NPM Search Node Documentation - Primary documentation for the NPM Search node