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

dynamixx

v1.0.2

Published

Zero-boilerplate dynamic state management system built on Zustand

Readme

Dynamixx Store (Beta)

🧪 Currently in testing phase - A minimal experiment in zero-boilerplate state management for React.

An experimental package that lets you add and manage state dynamically with zero configuration. Built on top of Zustand.

Features

  • 🚀 Zero Boilerplate: Just import and start using - no setup needed
  • 💾 Auto-Persistence: State automatically persists in localStorage
  • 🔄 Dynamic State: Add or remove state as you need it
  • 🎯 TypeScript Ready: Full type support included

Installation

npm install dynamixx
# or
yarn add dynamixx

Usage Examples

1. Dynamic Store (Zero Boilerplate)

Perfect for rapid development and dynamic data needs.

import { useDynamicStore } from "dynamixx";

// --- Authentication & User Management ---
function AuthComponent() {
  const { addState, removeState, updateState } = useDynamicStore();

  // Add user data after login
  const handleLogin = async (credentials) => {
    const userData = await loginAPI(credentials);
    addState("user", userData);
    addState("isAuthenticated", true);
  };

  // Clean up on logout
  const handleLogout = () => {
    removeState("user");
    removeState("isAuthenticated");
  };

  // Update user preferences
  const updatePreferences = (newPrefs) => {
    const { user } = useDynamicStore();
    updateState("user", {
      ...user,
      preferences: { ...user.preferences, ...newPrefs },
    });
  };
}

// --- Shopping Cart Management ---
function CartComponent() {
  const { addState, updateState } = useDynamicStore();

  // Initialize cart
  useEffect(() => {
    addState("cart", { items: [], total: 0 });
  }, []);

  // Use cart state
  const { cart } = useDynamicStore();

  const addToCart = (product) => {
    updateState("cart", {
      items: [...cart.items, product],
      total: cart.total + product.price,
    });
  };
}

// --- Theme Management ---
function ThemeComponent() {
  const { addState, updateState } = useDynamicStore();

  // Initialize theme
  useEffect(() => {
    addState("theme", {
      mode: "light",
      colors: {
        primary: "#007bff",
        secondary: "#6c757d",
      },
    });
  }, []);

  // Use theme state
  const { theme } = useDynamicStore();

  const toggleTheme = () => {
    updateState("theme", {
      ...theme,
      mode: theme.mode === "light" ? "dark" : "light",
    });
  };
}

2. Custom Store (Traditional Zustand Style)

For cases where you prefer a more structured approach with TypeScript.

import { createStore } from "dynamixx";

// Define your store types
interface Todo {
  id: number;
  text: string;
  completed: boolean;
}

interface TodoStore {
  todos: Todo[];
  filter: "all" | "active" | "completed";
  addTodo: (text: string) => void;
  toggleTodo: (id: number) => void;
  setFilter: (filter: "all" | "active" | "completed") => void;
  filteredTodos: () => Todo[];
}

// Create a typed store with persistence
const useTodoStore = createStore<TodoStore>({
  name: "todo-store",
  initialState: {
    todos: [],
    filter: "all",

    // Actions
    addTodo: (text: string) => {
      const todo: Todo = {
        id: Date.now(),
        text,
        completed: false,
      };
      useTodoStore.setState((state) => ({
        todos: [...state.todos, todo],
      }));
    },

    toggleTodo: (id: number) => {
      useTodoStore.setState((state) => ({
        todos: state.todos.map((todo) =>
          todo.id === id ? { ...todo, completed: !todo.completed } : todo
        ),
      }));
    },

    setFilter: (filter: "all" | "active" | "completed") => {
      useTodoStore.setState({ filter });
    },

    // Computed value
    filteredTodos: () => {
      const state = useTodoStore.getState();
      switch (state.filter) {
        case "active":
          return state.todos.filter((todo) => !todo.completed);
        case "completed":
          return state.todos.filter((todo) => todo.completed);
        default:
          return state.todos;
      }
    },
  },
});

// Use in components
function TodoApp() {
  const { todos, addTodo, toggleTodo, filter, setFilter, filteredTodos } =
    useTodoStore();

  return (
    <div>
      <input
        type="text"
        onKeyPress={(e) => {
          if (e.key === "Enter") {
            addTodo(e.currentTarget.value);
            e.currentTarget.value = "";
          }
        }}
        placeholder="Add todo"
      />

      <div>
        <button onClick={() => setFilter("all")}>All</button>
        <button onClick={() => setFilter("active")}>Active</button>
        <button onClick={() => setFilter("completed")}>Completed</button>
      </div>

      <ul>
        {filteredTodos().map((todo) => (
          <li
            key={todo.id}
            onClick={() => toggleTodo(todo.id)}
            style={{
              textDecoration: todo.completed ? "line-through" : "none",
            }}
          >
            {todo.text}
          </li>
        ))}
      </ul>
    </div>
  );
}

API Reference

Dynamic Store (Beta Feature)

const {
  addState, // Add any state: addState(key, value)
  updateState, // Update state: updateState(key, newValue)
  removeState, // Remove state: removeState(key)
  getState, // Get state: getState(key)
  resetState, // Reset all state
} = useDynamicStore();

Custom Store

const useStore = createStore<T>({
  name: string, // Store name for persistence
  initialState: T, // Initial state and methods
});

Current Limitations (Beta)

  • 🧪 This is an experimental package
  • 📦 All state is persisted to localStorage
  • 🔄 No custom persistence options yet
  • ⚠️ May have unexpected behaviors with complex nested state

Contributing

This is an experimental project and we welcome feedback and contributions! Feel free to:

  • Report bugs
  • Suggest features
  • Submit pull requests
  • Share use cases

License

MIT