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

cartmanagerjs

v1.0.2

Published

A mini Javascript library for managing shopify cart made easy

Readme

Shopify Cart Manager JS

A mini Cart Management Vanilla Javascript Library made for Shopify developers with No Dependency + Jquery. The idea was initally mapped with CartJS.Org ,to make a cartjs library without Jquery and add-on Improvmenets

Features

  • Zero Dependency Shopify Javascript library for cart management.
  • No requirement for jQuery.
  • Methods like AddCartitem,updatecartitem,getCart,clearCart avaiable similar to CartJS.
  • PatchCart Method added : Add products if it doesn't exist to cart or Update the cart qty.
  • Small size.
  • Returns Updated CartData with each request.
  • Custom properties supported.
  • Update/ Add product to cart Based upon variatnID / cart line item KEY

Getting started

npm i cartmanagerjs

Example usage:

const cartManager = new CartManager();

👀 Get cart items
cartManager.getCart().then(cartData => {
   console.log('Cart Data:', cartData);
 });

👀 Add item to cart
cartManager.addItem('123456789', 2).then(cartData => {
   console.log('Added to Cart:', cartData);
    });

👀 Add item to cart with custom line item properties
 const customProperties = {
   color: 'Red',
   size: 'Large',
   customField: 'Value',
 };

 cartManager.addItem('123456789', 2, customProperties).then(cartData => {
   console.log('Added to Cart with Custom Properties:', cartData);
 });

👀 Remove item from cart
cartManager.removeItem('123456789').then(cartData => {
   console.log('Removed from Cart:', cartData);
 });

👀 Update item quantity in cart
 cartManager.updateItem('123456789', 3).then(cartData => {
   console.log('Updated Cart:', cartData);
 });


👀 Fetch the cart
cartManager.fetchCart().then(() => {
   Update a cart item by key
    cartManager.updateItem('your_item_key_here', 2, { custom_property: 'new_value' });

   // Or update a cart item by variantId
   cartManager.updateItem('your_variant_id_here', 3, { custom_property: 'another_value' });
 });

👀  Patch the CartItem
cartManager.patchCartItem('your-identifier', 'your-variant-id', 2, { customProperty: 'value' });

Improvement

Please ⭐️ star this repo to add more frequest updates, PR's welcomes

Todo

  • [ ] Support for setNotes in CartJS