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

cart-fast

v1.1.0

Published

A fast, lightweight shopping cart component built with Svelte and Tailwind CSS

Downloads

28

Readme

Cart Fast 🛒

A fast, lightweight shopping cart component built with Svelte and Tailwind CSS. Perfect for e-commerce applications that need a performant, customizable cart solution.

Features

  • 🚀 Lightning fast - Built with Svelte 5 for optimal performance
  • 🎨 Fully customizable - Styled with Tailwind CSS
  • 📱 Responsive - Works great on all devices
  • 🔧 Easy integration - Simple API for any web application
  • 🌐 CDN ready - Available via jsDelivr
  • 💾 Persistent state - Cart data persists across sessions

Installation

Via CDN (Recommended)

<script src="https://cdn.jsdelivr.net/npm/cart-fast@latest/dist/cart-fast.umd.js"></script>

Via npm

npm install cart-fast

Quick Start

HTML + CDN

<!DOCTYPE html>
<html>
  <head>
    <script src="https://cdn.jsdelivr.net/npm/cart-fast@latest/dist/cart-fast.umd.js"></script>
  </head>
  <body>
    <div id="cart-container"></div>

    <script>
      // Initialize the cart
      CartFast.renderCart(document.getElementById("cart-container"), {
        items: [
          {
            id: "1",
            name: "Product 1",
            price: 29.99,
            quantity: 1,
            image: "https://example.com/image.jpg",
          },
        ],
      });
    </script>
  </body>
</html>

ES Modules

import { CartFast } from "cart-fast";

// Initialize the cart
CartFast.renderCart(document.getElementById("cart-container"), {
  items: [
    {
      id: "1",
      name: "Product 1",
      price: 29.99,
      quantity: 1,
      image: "https://example.com/image.jpg",
    },
  ],
});

API Reference

CartFast.renderCart(element, props)

Renders the cart component into the specified DOM element.

Parameters:

  • element (HTMLElement): The DOM element to render the cart into
  • props (Object): Configuration object

Props:

  • items (Array): Array of cart items
  • currency (String): Currency symbol (default: '$')
  • onUpdate (Function): Callback when cart is updated
  • onCheckout (Function): Callback when checkout is initiated

Cart Item Object

{
    id: 'unique-id',        // Required: Unique identifier
    name: 'Product Name',   // Required: Product name
    price: 29.99,          // Required: Product price
    quantity: 1,           // Required: Quantity in cart
    image: 'image-url',    // Optional: Product image URL
    description: 'text'    // Optional: Product description
}

Cart Actions

// Add item to cart
CartFast.addItem(item);

// Remove item from cart
CartFast.removeItem(itemId);

// Update item quantity
CartFast.updateQuantity(itemId, newQuantity);

// Clear entire cart
CartFast.clearCart();

// Get cart total
const total = CartFast.getTotal();

// Get cart items
const items = CartFast.getItems();

Styling

Cart Fast uses Tailwind CSS for styling. The component includes all necessary styles, but you can customize the appearance by overriding CSS classes or using Tailwind's utility classes.

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see the LICENSE file for details.

Changelog

v1.0.0

  • Initial release
  • Basic cart functionality
  • Responsive design
  • CDN distribution