Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@deckweiss/cart
Advanced tools
This is a shopping cart implementation for SvelteKit applications at Deckweiss.
This is a shopping cart implementation for SvelteKit applications at Deckweiss.
pnpm i @deckweiss/cart
// src/hooks.client.ts
import { initializeClientCart } from '@deckweiss/cart'
initializeClientCart()
// src/hooks.server.ts
import { handle } from '@deckweiss/cart'
export { handle }
<script lang="ts">
import { cart, addOrAppendToProduct, removeProduct, clearCart } from '@deckweiss/cart'
</script>
<button on:click={() => addOrAppendToProduct('id1', 1)}>Add product 1</button>
<button on:click={() => addOrAppendToProduct('id2', 1)}>Add product 2</button>
<button on:click={clearCart}>Clear cart</button>
{#each $cart.products as product}
<div>
<h3>{product.id}</h3>
<p>Amount: {product.amount}</p>
<button on:click={() => removeProduct(product.id)}>Remove product</button>
</div>
{:else}
<p>Cart is empty</p>
{/each}
The types CartMetaData
and CartProductMetaData
support to be extended/augmented via TypeScript. This means, your editor will recognize the custom types and give you intellisense.
// src/app.d.ts
declare module '@deckweiss/cart' {
interface CartMetaData {
userId?: string
note?: string
discountCode?: string
}
interface CartProductMetaData {
type?: 'food' | 'tool' | 'book'
}
}
FAQs
This is a shopping cart implementation for SvelteKit applications at Deckweiss.
The npm package @deckweiss/cart receives a total of 1 weekly downloads. As such, @deckweiss/cart popularity was classified as not popular.
We found that @deckweiss/cart demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.