@link-assistant/web-search
v0.10.3
Published
A 40-provider web search microservice and library with typed provider metadata, reranking, and optional web-capture backing
Maintainers
Readme
@link-assistant/web-search
JavaScript implementation of the web-search library, CLI, and HTTP service.
It mirrors the Rust crate in ../rust with the same 22-provider catalog, four
provider categories, merge strategies, and discovery surface.
Install
npm install @link-assistant/web-search
bun add @link-assistant/web-search
yarn add @link-assistant/web-searchThe package publishes only runtime assets (src, bin, examples, README,
and changelog). It is a public scoped package and uses the repository directory
metadata required by npm for packages stored below the repository root.
Library
import {
createSearchEngine,
buildProviders,
getProviderIds,
} from '@link-assistant/web-search';
const engine = createSearchEngine();
const results = await engine.search('graph neural networks', {
limit: 10,
providers: ['arxiv', 'crossref', 'openalex'],
strategy: 'rrf',
});
const github = buildProviders().get('github');
const codeResults = await github.search('web search cli', { limit: 5 });
console.log(getProviderIds('papers'));
console.log(results.map((result) => result.url));
console.log(codeResults.length);CLI
npx web-search "rust async search" --limit 10
npx web-search "transformer architecture" --providers arxiv,crossref --format json
npx web-search --list-providersHTTP Service
npx web-search serve --port 3000
curl "http://localhost:3000/search?q=rust+programming&limit=10"
curl "http://localhost:3000/providers?category=papers"
curl "http://localhost:3000/categories"Providers
The live registry has 22 providers in four categories:
| Category | Provider ids |
| ----------- | ---------------------------------------------------------------------------------------------------------- |
| search | google, bing, duckduckgo, searx, brave, mojeek, ecosia, startpage, yahoo, lite, wc:* |
| knowledge | wikipedia, wikidata |
| papers | crossref, openalex, arxiv |
| code | github, hackernews |
google and bing use official APIs when credentials are configured and fall
back to HTML parsing otherwise. GITHUB_TOKEN is optional and raises the GitHub
search rate limit.
web-capture
wc:wikipedia, wc:duckduckgo, wc:google, wc:bing, and wc:brave delegate
to @link-assistant/web-capture when it is installed. The dependency is loaded
lazily; without it, the provider warns once and returns an empty result set so
the rest of aggregation can continue.
npm install @link-assistant/web-captureimport { createWebCaptureProvider } from '@link-assistant/web-search';
const provider = createWebCaptureProvider({ engine: 'wikipedia' });
const results = await provider.search('OpenAI', { limit: 5 });Release
The JavaScript release workflow publishes through npm trusted publishing and
creates GitHub releases tagged as js-v<version>. Version changes are managed
with changesets; pull requests that touch JavaScript package code should add a
changeset in .changeset/.
npm run changeset
npm run changeset:status
npm publish --dry-run --jsonDevelopment
npm install
npm test
npm run check
node bin/web-search.js --list-providersCross-language parity is checked from the repository root:
node js/scripts/check-js-rust-parity.mjs