Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
cart-localstorage
Advanced tools
Tiny shopping cart on top of LolcalStorage - ES6, < 1Kb, test coverage
Super Simple Shopping Cart on top of browser localStorage with a very small footprint (~1Kb, 0 dependencies)
//todo add codepen demo
This is a JavaScript ES6 library. Use npm or yarn to add it to your project:
npm install cart-localstorage
or
yarn install cart-localstorage
import Cart from 'cart-localstorage'
Cart.add({id: 1, name: "Product 1", price: 100},1)
console.log(Cart.total())
// output: 100
...
## API
Array of products in the cart.
list()
// output: [{id: 1, name: "Nike Air", price: 100, quantity: 1}, {id: 1, name: "Adidas Superstar", price: 120, quantity: 2}]
Get product by id
get(1)
// output: [{id: 1, name: "Nike Air", price: 100, quantity: 1}]
Adds product into the cart. If a product exists with the same increases the quantity only.
add({id: 3, name: "Vans", price: 75, quantity: 2})
Removes product by id
remove(1)
Updates the product quantity on a specific product
update(1,5)
total()
detroy()
## License
This plugin is available under Apache 2.0 license.
FAQs
Tiny shopping cart on top of LolcalStorage - ES6, < 1Kb, full test coverage
The npm package cart-localstorage receives a total of 272 weekly downloads. As such, cart-localstorage popularity was classified as not popular.
We found that cart-localstorage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.