How eudalabs/ddgs works
DDGS is a Node.js wrapper that uses a browser to retrieve DuckDuckGo web, image, video, and news search results. A consumer calls the exported service facade, which delegates each search to a dedicated service; the service validates the query, configures a browser page, navigates to DuckDuckGo, and extracts results. Shared browser setup and error handling support these flows. The news service is included based on the README and source tree; its implementation was not sampled, so its internal wiring is not expanded.
Main entry points: index.ts Service Facade · search.ts Web Search · images.ts Image Search · videos.ts Video Search
Components 11
Public API
- Package Exports
src/index.ts - Service Facade
src/services/index.ts
Search Services
- Web Search
src/services/search.ts - Image Search
src/services/images.ts - Video Search
src/services/videos.ts - News Search
src/services/news.ts
Shared Runtime
- Page Selectors
src/selectors.ts - Browser Support
src/services/base.ts - Error Handling
src/errors.ts
Other components
- Library Consumer
- DuckDuckGo
Connections 24
- Library Consumer → Package Exports: imports
- Package Exports → Service Facade: exports
- Library Consumer → Service Facade: calls API
- Service Facade → Web Search: delegates search
- Service Facade → Image Search: delegates images
- Service Facade → Video Search: delegates videos
- Service Facade → News Search: delegates news
- Web Search → Browser Support: uses browser support
- Image Search → Browser Support: uses browser support
- Video Search → Browser Support: uses browser support
- Web Search → Page Selectors: reads selectors
- Image Search → Page Selectors: reads selectors
- Video Search → Page Selectors: reads selectors
- Web Search → DuckDuckGo: navigates and reads
- Image Search → DuckDuckGo: navigates and reads
- Video Search → DuckDuckGo: navigates and reads
- Web Search → Error Handling: raises errors
- Image Search → Error Handling: raises errors
- Video Search → Error Handling: raises errors
- Web Search → Service Facade: returns results
- Image Search → Service Facade: returns results
- Video Search → Service Facade: returns results
- News Search → Service Facade: returns results
- Service Facade → Library Consumer: returns results