
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-searchx
Advanced tools
A lightweight search library with caching, pagination, and debouncing, built for React. It helps avoid unnecessary API calls while typing and provides a hook for seamless integration in React apps.
loadMore)useSearch) for easy integrationnpm install react-searchx
or
yarn add react-searchx
Your API function must return an object with { items: [], total: number }.
async function myApi(query, limit, offset, signal) {
const res = await fetch(
`/api/search?q=${query}&limit=${limit}&offset=${offset}`,
{ signal }
);
return res.json(); // should be { items: [...], total: 100 }
}
useSearch hook in Reactimport React, { useState } from "react";
import useSearch from "react-searchx";
export default function App() {
const { items, loading, hasMore, setQuery, loadMore } = useSearch(myApi, {
debounceTime: 500,
limit: 10,
});
return (
<div>
<input
type="text"
placeholder="Search..."
onChange={(e) => setQuery(e.target.value)}
/>
{loading && <p>Loading...</p>}
<ul>
{items.map((item, i) => (
<li key={i}>{item.name}</li>
))}
</ul>
{hasMore && <button onClick={loadMore}>Load More</button>}
</div>
);
}
import SearchLibrary from "react-searchx/lib/searchLibrary.js";
const searchLib = new SearchLibrary(myApi, { debounceTime: 400 });
searchLib.search("apple").then((res) => {
console.log(res.items); // combined items
console.log(res.total); // total count
});
useSearch(apiFn, options)apiFn(query, limit, offset, signal) → must return { items, total }options.debounceTime → debounce delay in ms (default 400)options.limit → number of items per page (default 20)Returns:
items: array of resultstotal: total number of resultsloading: booleanhasMore: booleansetQuery(query: string): set the search stringloadMore(): fetch the next pageSearchLibraryClass-based API if you don’t use React.
Methods:
search(query, limit) → fetch first page with debounceloadMore(query, limit) → fetch next pagefetchPage(query, limit, offset) → fetch specific pageMIT © 2025 Uditha Vithanage
FAQs
Debounced search library with caching and pagination for React
We found that react-searchx demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.