npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@eleven-am/searxng-sdk

v0.0.6

Published

A strongly-typed TypeScript client for interacting with SearXNG, a privacy-focused metasearch engine.

Readme

SearXNG TypeScript SDK

A strongly-typed TypeScript client for interacting with SearXNG, a privacy-focused metasearch engine.

Features

  • Fully TypeScript: Type-safe API with proper TypeScript definitions
  • Zod Validation: Runtime validation of API responses
  • Fluent Interface: Chainable methods for configuring search requests
  • Complete API Coverage: Support for all SearXNG search parameters
  • Modern: Uses native fetch API and modern ES features
  • Flexible: Works in Node.js, browsers and other JavaScript runtimes

Installation

npm install @eleven-am/searxng-sdk

Quick Start

import { SearXNGClient } from '@eleven-am/searxng-sdk';

// Initialize with your SearXNG instance URL
const searx = new SearXNGClient('https://your-searxng-instance.org');

// Perform a simple search
async function searchExample() {
  try {
    const results = await searx.search('privacy tools');
    console.log(`Found ${results.results.length} results`);
    
    // Results are typed!
    results.results.forEach(result => {
      console.log(`${result.title}: ${result.url}`);
    });
  } catch (error) {
    console.error('Search failed:', error);
  }
}

searchExample();

Advanced Usage

Configuring Searches

import { SearXNGClient, Format, TimeRange, SafeSearchLevel } from '@eleven-am/searxng-sdk';

const searx = new SearXNGClient('https://your-searxng-instance.org');

async function advancedSearch() {
  const results = await searx
    .setLanguage('en')
    .setSafeSearch(SafeSearchLevel.MODERATE)
    .setTimeRange(TimeRange.MONTH)
    .setCategories(['general', 'science'])
    .setEngines(['google', 'bing', 'duckduckgo'])
    .setPage(1)
    .setFormat(Format.JSON)
    .search('climate change research');
    
  // Process results
  console.log(`Found ${results.results.length} results`);
}

Custom Headers

searx.setHeaders({
  'User-Agent': 'My Custom App/1.0',
  'Authorization': 'Bearer token123'
});

Working with Plugins

// Enable specific plugins
searx.enablePlugins(['Hash_plugin', 'Tracker_URL_remover']);

// Disable specific plugins
searx.disablePlugins(['Vim-like_hotkeys']);

API Reference

Method Parameters

| Method | Parameters | Description | |---------------------|--------------------------------------|---------------------------------------------------| | constructor | baseUrl: string | Base URL of the SearXNG instance | | | defaultOptions?: SearXNGOptions | Default options for all requests | | search | query: string | The search query | | | options?: SearXNGOptions | Additional options for this specific search | | setHeaders | headers: Record<string, string> | Custom HTTP headers for requests | | setLanguage | language: string | Language code (e.g., 'en', 'fr', 'de') | | setSafeSearch | level: SafeSearchLevel | Safe search level (0=off, 1=moderate, 2=strict) | | setTimeRange | timeRange: TimeRange | Time range ('day', 'month', 'year') | | setPage | pageNumber: number | Page number (starts at 1) | | setCategories | categories: string \| string[] | Category or list of categories | | setEngines | engines: string \| string[] | Engine name or list of engine names | | enablePlugins | plugins: string \| string[] | Plugin name or list of plugin names | | disablePlugins | plugins: string \| string[] | Plugin name or list of plugin names | | setFormat | format: Format | Output format ('json', 'csv', 'rss') |

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

GPL-3.0