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

optiflow

v1.0.0

Published

Zero-latency Optimistic CRUD engine for React and Vanilla JS MERN Stack applications.

Readme

OptiFlow (Zero-Latency CRUD Engine)

A lightweight data-fetching package with auto-caching, deduplication, and a "Zero-Latency" Optimistic CRUD Engine.

Installation

npm install optiflow react

Usage in React (Zero-Latency CRUD)

The useCrud hook automatically handles Optimistic UI Updates. When you create, update, or delete an item, the UI updates instantly (0ms delay). If the backend API fails, the engine automatically rolls back the UI to its previous state and shows an error toast.

import React from 'react';
import { useCrud } from 'optiflow';

function TodoApp() {
  // 1. Fetch initial data
  const { data, isLoading, createData, updateData, deleteData } = useCrud(
    'todos', 
    () => fetch('/api/todos').then(res => res.json())
  );

  // 2. Create (Optimistic Update)
  const handleAdd = () => {
    const newTodo = { title: "New Task", completed: false };
    
    // UI updates INSTANTLY, API call happens in the background
    createData(
      newTodo, 
      (item) => fetch('/api/todos', { method: 'POST', body: JSON.stringify(item) }).then(r => r.json())
    );
  };

  // 3. Update (Optimistic Update)
  const handleToggle = (todo) => {
    updateData(
      todo.id || todo._id, 
      { completed: !todo.completed }, 
      (updated) => fetch(`/api/todos/${todo.id || todo._id}`, { method: 'PUT', body: JSON.stringify(updated) }).then(r => r.json())
    );
  };

  // 4. Delete (Optimistic Update)
  const handleDelete = (id) => {
    deleteData(
      id, 
      (id) => fetch(`/api/todos/${id}`, { method: 'DELETE' })
    );
  };

  if (isLoading) return <div>Loading...</div>;

  return (
    <div>
      <button onClick={handleAdd}>Add Todo</button>
      <ul>
        {data?.map(todo => (
          <li key={todo.id || todo._id}>
            <span style={{ textDecoration: todo.completed ? 'line-through' : 'none' }}>{todo.title}</span>
            <button onClick={() => handleToggle(todo)}>Toggle</button>
            <button onClick={() => handleDelete(todo.id || todo._id)}>Delete</button>
          </li>
        ))}
      </ul>
    </div>
  );
}

export default TodoApp;

Features

  • Zero-Latency UI: Frontend doesn't wait for the backend to complete CRUD operations.
  • Auto-Rollback: Automatically undoes the UI change if the backend fails.
  • Built-in Error Toasts: Shows a non-intrusive toast notification on failure.
  • Framework Agnostic Core: The core logic is separate, allowing easy integration with Vanilla JS or other frameworks.