{"_id":"@arvidalund/simplecart","name":"@arvidalund/simplecart","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@arvidalund/simplecart","version":"1.0.0","description":"A lightweight shopping cart system for web apps","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","type":"module","scripts":{"build":"npx tsup src/index.js --format esm,cjs --dts","test":"vitest"},"keywords":["cart","ecommerce","shopping","npm"],"author":{"name":"Arvid Ålund"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ArvidAlund/simpleCart.git"},"bugs":{"url":"https://github.com/ArvidAlund/simpleCart/issues"},"homepage":"https://github.com/ArvidAlund/simpleCart#readme","devDependencies":{"tsup":"^8.5.0","typescript":"^5.9.3"},"_id":"@arvidalund/simplecart@1.0.0","gitHead":"c83bd07c88339b0eb13392edb0b50e865c939441","_nodeVersion":"22.18.0","_npmVersion":"11.5.2","dist":{"integrity":"sha512-rzvXaHkvK3Yc+YenkV/9qMwTA8IbuKVJzCMhEoZR/KEPYF46X0GjjSw7cmvwvXA7bLBsqz8s+2EzSW3D49fZVQ==","shasum":"283440619e58d6e860589e40d181c628fc0b3727","tarball":"https://registry.npmjs.org/@arvidalund/simplecart/-/simplecart-1.0.0.tgz","fileCount":7,"unpackedSize":12385,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBbfZUXVyGUuOaX6fuTFebGRpvJulgEDnOALgjwUEnItAiAexc+rgGrT3EmPVCxtLiyrw6xbsk5YYrMkXESNWNRDwQ=="}]},"_npmUser":{"name":"arvidalund","email":"arvid.alund@gmail.com"},"directories":{},"maintainers":[{"name":"arvidalund","email":"arvid.alund@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/simplecart_1.0.0_1760352275730_0.22127945018779682"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-13T10:44:35.644Z","1.0.0":"2025-10-13T10:44:35.894Z","modified":"2025-10-13T10:44:36.150Z"},"maintainers":[{"name":"arvidalund","email":"arvid.alund@gmail.com"}],"description":"A lightweight shopping cart system for web apps","homepage":"https://github.com/ArvidAlund/simpleCart#readme","keywords":["cart","ecommerce","shopping","npm"],"repository":{"type":"git","url":"git+https://github.com/ArvidAlund/simpleCart.git"},"author":{"name":"Arvid Ålund"},"bugs":{"url":"https://github.com/ArvidAlund/simpleCart/issues"},"license":"MIT","readme":"<!-- Improved compatibility of back to top link -->\r\n\r\n<a id=\"readme-top\"></a>\r\n\r\n<!-- PROJECT SHIELDS -->\r\n\r\n[![Contributors][contributors-shield]][contributors-url]\r\n[![Forks][forks-shield]][forks-url]\r\n[![Stargazers][stars-shield]][stars-url]\r\n[![Issues][issues-shield]][issues-url]\r\n[![project_license][license-shield]][license-url]\r\n[![LinkedIn][linkedin-shield]][linkedin-url]\r\n\r\n<!-- PROJECT LOGO -->\r\n<br />\r\n<div align=\"center\">\r\n  <a href=\"https://github.com/ArvidAlund/simple-cart\">\r\n    <img src=\"public/favicon.png\" alt=\"Logo\" width=\"100\" height=\"100\">\r\n  </a>\r\n\r\n  <h3 align=\"center\">Simple Cart</h3>\r\n\r\n  <p align=\"center\">\r\n    A lightweight and flexible shopping cart system for JavaScript and TypeScript projects.  \r\n    <br />\r\n    This library helps you manage cart items, quantities, totals, and storage in a simple and framework-agnostic way.\r\n    <br />\r\n    <br />\r\n    &middot;\r\n    <a href=\"https://github.com/ArvidAlund/simple-cart/issues/new?labels=bug&template=bug-report---.md\">Rapportera bugg</a>\r\n    &middot;\r\n    <a href=\"https://github.com/ArvidAlund/simple-cart/issues/new?labels=enhancement&template=feature-request---.md\">Föreslå funktion</a>\r\n  </p>\r\n</div>\r\n\r\n---\r\n\r\n## Features\r\n\r\n- Add, remove, and update cart items\r\n- Get total price of items in the cart\r\n- Persist cart using localStorage, sessionStorage, or a custom storage adapter\r\n- Fully TypeScript-compatible with strong typing\r\n- Small and easy to integrate in any web app\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n---\r\n\r\n## Getting Started\r\n\r\n### Installation\r\n\r\n```bash\r\nnpm install @ArvidAlund/simpleCart\r\n# or\r\nyarn add @ArvidAlund/simpleCart\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n---\r\n\r\n## Usage Example\r\n\r\n```bash\r\nimport { Cart, localStorageAdapter } from \"@ArvidAlund/simpleCart\";\r\n\r\n// Initialize cart with localStorage\r\nconst cart = new Cart(localStorageAdapter);\r\n\r\n// Add items\r\ncart.add({ id: 1, name: \"Sneakers\", price: 799, quantity: 2 });\r\ncart.add({ id: 2, name: \"T-Shirt\", price: 199, quantity: 1 });\r\n\r\n// Update quantity\r\ncart.updateQuantity(1, 3);\r\n\r\n// Remove item\r\ncart.remove(2);\r\n\r\n// Get total price\r\nconsole.log(cart.getTotal()); // 3*799 = 2397\r\n\r\n// Clear cart\r\ncart.clear();\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Please open an issue or submit a pull request.\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## 📫 Contact\r\n\r\nArvid Ålund\r\n[LinkedIn][linkedin-url]\r\n• [GitHub](https://github.com/ArvidAlund)\r\n\r\nProjektlänk: https://github.com/ArvidAlund/simple-cart\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## 🧾 License\r\n\r\nDistributed under the MIT License. See <a href=\"/LICENSE.md\">LICENSE.md</a> for more information.\r\n\r\n[contributors-shield]: https://img.shields.io/github/contributors/ArvidAlund/simple-cart.svg?style=for-the-badge\r\n[contributors-url]: https://github.com/ArvidAlund/simple-cart/graphs/contributors\r\n[forks-shield]: https://img.shields.io/github/forks/ArvidAlund/simple-cart.svg?style=for-the-badge\r\n[forks-url]: https://github.com/ArvidAlund/simple-cart/network/members\r\n[stars-shield]: https://img.shields.io/github/stars/ArvidAlund/simple-cart.svg?style=for-the-badge\r\n[stars-url]: https://github.com/ArvidAlund/simple-cart/stargazers\r\n[issues-shield]: https://img.shields.io/github/issues/ArvidAlund/simple-cart.svg?style=for-the-badge\r\n[issues-url]: https://github.com/ArvidAlund/simple-cart/issues\r\n[license-shield]: https://img.shields.io/github/license/ArvidAlund/simple-cart.svg?style=for-the-badge\r\n[license-url]: https://github.com/ArvidAlund/simple-cart/blob/master/LICENSE.txt\r\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555\r\n[linkedin-url]: https://www.linkedin.com/in/ArvidAlund/\r\n","readmeFilename":"README.md","_rev":"1-ec4263a8693ef0b6b407f79e03b9ae82"}