ecommerce-lib
TypeScript icon, indicating that this package has built-in type declarations

0.6.8 • Public • Published

ecommerce lib

Features

  • Type base Shop Cart
  • Calculate total and subtotal of a Cart

Installing

$ npm install ecommerce-lib

Example

// for v3 payload
const cart = Cart.fromShopCart(data.json);
// or for v4 payload
const cart = Cart.from(data.json);

cart.items[1].setQuantity(5);

const total = cart.getTotal();
const subtotal = cart.getSubtotal();

Publish

npm install
npm run build
npm login
npm publish

/ecommerce-lib/

    Package Sidebar

    Install

    npm i ecommerce-lib

    Weekly Downloads

    3

    Version

    0.6.8

    License

    ISC

    Unpacked Size

    97.4 kB

    Total Files

    34

    Last publish

    Collaborators

    • diego-alves