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 🙏

© 2025 – Pkg Stats / Ryan Hefner

edenq

v0.1.0

Published

A TanStack Query wrapper for Elysaia Eden

Downloads

3

Readme

edenq

A TanStack Query (React Query) wrapper for Elysaia Eden.

Installation

npm install edenq

Usage Examples

Below are examples demonstrating how to use the custom hooks for mutations, queries, and infinite queries.

// Import or initialize your API instance (replace with your actual setup)
const api = treaty<App>("localhost:3000");
export default api;

// Create a login mutation hook using your endpoint
export const useLogin = createApiMutation(api.auth.login.post);

// In your component, use the mutation hook:
const loginMutation = useLogin({
    onSuccess: (data) => {
        // Do something after a successful login (e.g., redirect or show a success message)
        console.log("Login successful!", data);
    },
    onError: (error) => {
        // Handle errors here (e.g., show an error message)
        console.error("Login failed:", error);
    },
});

// To trigger the mutation (e.g., on form submit):
// loginMutation.mutate({ username: "user", password: "pass" });

Query Example

// Create a Query using your endpoint
export const useSearchUser = createApiQuery(api.user.search.get);

// In your componnet use the query
const { data, isLoading } = useSearchUser({
    query: {
        q: "ifty",
    },
});

Infinite Query Example: Paginated Posts

// Create an infinite query hook for fetching paginated posts
export const useInfinitePosts = createApiInfiniteQuery(api.posts.list.get);

// In your component, use the infinite query hook:
const {
    data: postsData,
    fetchNextPage,
    hasNextPage,
    isFetchingNextPage,
} = useInfinitePosts({ page: 1, limit: 10 }, {
    // Provide a function to get the next page parameter from the last page's data
    getNextPageParam: (lastPage) => lastPage.nextPage ?? false,
});

// Render the posts list (pseudo-code example):
return (
    <div>
        {postsData?.pages.map((page, pageIndex) => (
            <div key={pageIndex}>
                {page.posts.map((post: any) => (
                    <div key={post.id}>{post.title}</div>
                ))}
            </div>
        ))}
        <button onClick={() => fetchNextPage()} disabled={!hasNextPage || isFetchingNextPage}>
            {isFetchingNextPage ? "Loading more..." : "Load More"}
        </button>
    </div>
);