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 🙏

© 2026 – Pkg Stats / Ryan Hefner

queryfi

v1.4.0

Published

Meet Queryfi – the powerful package that enhances your API interactions with Laravel, offering the flexibility to build dynamic queries directly from your frontend, be it React or any other framework.

Readme

Introducing Queryfi: The Ultimate Query Builder for Your Laravel API

Are you tired of constantly jumping between your frontend and backend just to adjust filters, sort, paginate, or query related data(sounded like a commercial 😂)?

Meet Queryfi – the powerful package that enhances your API interactions with Laravel, offering the flexibility to build dynamic queries directly from your frontend, be it React or any other framework.

Why Queryfi?

Laravel is an amazing framework with fine-grained control over database interactions, but when it comes to APIs, there’s often friction. You find yourself constantly switching between frontend and backend just to tweak a filter, sort order, or pagination. This back-and-forth slows down development and can lead to a less efficient workflow. Queryfi changes that. It allows you to perform advanced queries with ease, directly from your frontend, saving you time and reducing the complexity of interacting with the backend.


What Makes Queryfi Special?

Queryfi streamlines API interactions by offering a rich set of features, allowing you to build, sort, paginate, and modify queries on the fly. No more manually adjusting API calls — Queryfi handles everything from complex filtering to related data fetching, making your API interactions smooth and efficient.

Key Features:

  • Dynamic Filtering: Perform flexible where conditions with a variety of operators, directly in your frontend.
  • Relation Handling: Automatically include related models with with(), and customize those relations with advanced query modifiers.
  • Flexible Ordering: Order results by any column, and easily control sorting direction.
  • Effortless Pagination: Handle pagination with ease, controlling both the number of results per page and which page to display.
  • Query Modifiers for Relations: Apply filters and ordering to related data, without touching the main query.
  • Limit Control: Limit the number of results returned, all from the frontend.
  • Custom Path Parameters: Add dynamic path parameters to your API endpoints for even more flexibility.

How Does It Work?

Queryfi is built on a simple, intuitive class that allows you to build complex queries without writing custom API endpoints every time. Here’s how it works:

Example Usage

import { createQuery } from 'queryfi';

const query = createQuery('/api/users', {
  baseUrl: 'http://localhost:8000'
})
  .with(['posts', 'profile']) // Include related data
  .where({ name: 'John' }) // Filter by name
  .where([
    ['age', '>=', 30],
    ['email', 'like', '%doe%']
  ]) // Filter by age and email pattern
  .orderBy('name:desc') // Sort by name in descending order
  .limit(10) // Limit results to 10
  .paginate(10, 2) // Paginate with 10 results per page, on page 2

const url = query.build(); // Build the final URL for the API request

console.log(url);

In the above example, Queryfi generates the following API URL dynamically:

GET /users?with=posts,profile&where[name]=John&where[age][gte]=30&orderBy[name]=desc&limit=10&page=2

This clean, easy-to-read URL is ready for use in your frontend API calls.


Fully Type-Safe and Extensible

Queryfi is built with TypeScript to ensure that your API calls are always type-safe. This helps you catch errors early during development, so you never have to worry about incorrect data formats or missing fields.


Check out the Documentation:

Visit the official Queryfi Documentation to explore all the features, usage examples, and integration guides.