DuckDuckGo web search library for JS runtimes, written in Go
bun add quack-search
# or
npm install quack-search
# or
yarn add quack-searchimport { search, fetchContent } from 'quack-search';
console.log(await search('golang', { maxResults: 5 }));
const page = await fetchContent("https://adistrim.in/now");
if (!page.success) {
console.log("Blocked:", page.reason);
} else {
console.log(page.text);
}- macOS (x64, ARM64)
- Linux (x64, ARM64)
- Windows (x64, ARM64)
For constrained environments where automatic download isn't possible:
Pre-install the binary and point to it:
export QUACK_BINARY_PATH=/usr/local/bin/quackDownload at build time (e.g., in a Dockerfile):
import { downloadBinary } from 'quack-search';
await downloadBinary({
targetDir: '/app/bin',
version: 'v0.1.0', // or 'latest'
verbose: true
});Install the platform-specific package directly:
npm install quack-search-linux-x64import { checkBinaryStatus } from 'quack-search';
const status = checkBinaryStatus();
console.log(status);
// { found: true, path: '/path/to/quack', source: 'node_modules', platform: 'darwin', arch: 'arm64' }Open to contributions! See the repository.
MIT License. See LICENSE file for details.