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

@3lineas/groovepack

v0.1.4

Published

Interactive CLI for sharing reusable library templates across projects without npm package clutter

Readme

📦 GroovePack (@3lineas/groovepack)

A modern, zero-dependency source code registry CLI for high-performance TypeScript & React applications.

Inspired by the shadcn philosophy: don't install heavy, unmaintainable dependencies—copy battle-tested, strictly typed, adaptable source modules directly into your project.

License: MIT TypeScript CLI Turborepo-free


🚀 Quick Start

Run the interactive CLI directly without installing anything globally:

npx @3lineas/groovepack

GroovePack will guide you through:

  1. Selecting a Domain Category (Common, React, Hono / Next Server, or Browse all).
  2. Selecting Libraries via an interactive multi-select prompt.
  3. Choosing the Destination Path (defaults to src/lib/<lib>).
  4. Copying the Source Code cleanly with transactional rollback guarantees.

💡 Why GroovePack?

Traditional npm packages often introduce:

  • Dependency bloat and version conflicts across monorepos.
  • Opaque abstractions that are difficult to customize for specific backend requirements.
  • Overhead in CI/CD pipelines.

GroovePack provides:

  • Zero Package Bloat: Code lives in your repo (src/lib/...). You own it, customize it, and debug it with standard breakpoints.
  • Enterprise-Grade Typing: 100% strict TypeScript without any or loose casts.
  • Transactional Rollback (Zero-Crash Policy): If disk writing, permissions, or I/O encounters an issue, GroovePack restores prior files and cleans newly created folders automatically without terminating the process.
  • Universal Runtime Compatibility: Node.js, Cloudflare Workers, Next.js (SSR / RSC), Astro Actions, and React Vite SPAs.

📚 Registry Catalog

1. common

🪵 logger

Universal structured logger designed for seamless local development and production observability.

  • Local Development: Human-readable ANSI color-coded terminal output with [file:line] context tracing.
  • Production / Cloudflare Workers: Fast, structured JSON serialization compatible with log aggregators (Datadog, Cloudflare Logpush, Axiom).
  • Default Target: src/lib/logger
import { Logger } from "@/lib/logger";

const logger = new Logger("AuthService");

logger.info("User registered successfully", { userId: "usr_101" });
logger.warn("Rate limit approaching", { ip: "192.168.1.1" });
logger.error("Database connection failure", { pool: "primary" }, error);

🌐 api-client

Hybrid universal HTTP client featuring REST convenience methods, dynamic authentication header injection, and optional Hono RPC integration.

  • REST Client: Typed get, post, put, patch, delete, and fetch with BigInt-safe JSON serialization.
  • Authentication: Dynamic bearer token resolver (browser localStorage, cookies, or custom async getToken() callback).
  • Hono RPC Factory: Exported createHonoClient<AppType>() helper to instantiate hc<AppType> with shared base URL and auth headers.
  • Default Target: src/lib/api-client
import { createApiClient, createHonoClient } from "@/lib/api-client";
import type { AppType } from "api";

// 1. REST Client
export const api = createApiClient({
  baseUrl: "https://api.example.com",
  getToken: () => localStorage.getItem("token"),
});

const res = await api.get("/users/me");

// 2. Hono RPC Client (Optional)
export const rpc = createHonoClient<AppType>({
  baseUrl: "http://localhost:8787",
});
const productRes = await rpc.v1.products.$get();

2. react

⚡ api-action

Universal async operation and API wrapper for React components, Server Actions, and custom hooks.

  • Polymorphic Compatibility: Natively accepts Hono RPC responses, standard fetch (Response), structured ActionResponse<T>, or raw promises.
  • Strict Error-Only Logging: Only logs on actual failures (!response.ok, !result.success, or unexpected runtime crashes). Does not pollute console logs on successful operations.
  • Default Target: src/lib/api-action
import { apiAction } from "@/lib/api-action";
import { api } from "@/lib/api-client";

export async function fetchCustomersAction() {
  return apiAction<Customer[]>({
    actionName: "fetchCustomers",
    apiCall: () => api.get("/customers"),
    onSuccess: (customers) => {
      console.log(`Loaded ${customers.length} customers`);
    },
  });
}

🔔 api-toast

User feedback utility built on top of sonner (toast.promise).

  • Tri-State Feedback: Automates loading, success, and error toasts for any apiAction or async procedure.
  • Typed Return: Directly returns the underlying Promise<ActionResponse<T>> for component state inspection.
  • Full Backward Compatibility: Exports both apiToast and toasted aliases.
  • Default Target: src/lib/api-toast
import { apiToast } from "@/lib/api-toast";
import { loginAction } from "@/actions/auth";

const handleSubmit = async (values: LoginFormValues) => {
  const result = await apiToast({
    action: () => loginAction(values),
    loadingMessage: "Authenticating credentials...",
    successMessage: (res) => `Welcome back, ${res.data?.name}!`,
    onSuccess: () => router.push("/dashboard"),
    onError: (err) => console.error("Login failed:", err),
  });

  if (result.success) {
    // Form submission complete
  }
};

3. server

🚀 pipeline

Laravel-style sequential execution pipeline with preventive in-memory rollback and atomic Cloudflare D1 batching.

  • Drizzle & D1 Agnostic: Works seamlessly with native Cloudflare D1 (env.DB / D1PreparedStatement), Drizzle ORM (drizzle(env.DB)), or pure in-memory business logic.
  • Strict Zero-Barrel Architecture: Concrete modular files (pipeline.ts, with-d1-transaction.ts, types.ts, README.md) designed for direct imports.
  • Preventive Rollback: If any action throws an error (e.g. domain exception), the pipeline stops immediately and zero mutations hit D1.
  • Atomic Batch Commit: Staged statements (tx.stage(...)) are committed in a single atomic db.batch() call upon completion.
  • Default Target: src/lib/pipeline
import { Pipeline } from "@/lib/pipeline/pipeline";
import type { D1TransactionContext } from "@/lib/pipeline/types";

// 1. Native Cloudflare D1 (env.DB)
const result = await Pipeline.send<UserContext>({ db: env.DB, input })
  .transactional(env.DB)
  .through([
    async (ctx) => {
      // Immediate read
      const existing = await ctx.tx!.db.prepare("SELECT id FROM users WHERE email = ?").bind(ctx.input.email).first();
      if (existing) throw new Error("Email already registered");
      
      // Stage atomic mutation
      ctx.tx!.stage(
        ctx.tx!.db.prepare("INSERT INTO users (id, email) VALUES (?, ?)").bind(newId, ctx.input.email)
      );
      return ctx;
    }
  ])
  .thenReturn();

// 2. Drizzle ORM on D1
const res = await Pipeline.send<UserContext>({ db, input })
  .transactional(db)
  .through([validateEmailAction, stageCreateUserAction])
  .then((ctx) => ctx.createdUser!);

🛡️ Fault Tolerance & Atomic Rollbacks

When installing libraries, GroovePack uses an internal RollbackManager that:

  1. Tracks all filesystem operations and directories created during the transaction.
  2. Backs up pre-existing destination files in memory before applying changes.
  3. If an error occurs (such as permission denials, path errors, or disk write failures):
    • Restores original file contents.
    • Removes newly written files.
    • Cleans up empty directory segments.
    • Reports the exact failure cause in the terminal without crashing or interrupting the installation of other selected packages.

📄 License

MIT © 3-Lineas