@chiper-inc/ecommerce-lib
TypeScript icon, indicating that this package has built-in type declarations

1.3.5 • 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].quanitty = 5;

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

Publish

npm install
npm run build
npm login
npm publish

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i @chiper-inc/ecommerce-lib

    Weekly Downloads

    120

    Version

    1.3.5

    License

    ISC

    Unpacked Size

    140 kB

    Total Files

    50

    Last publish

    Collaborators

    • chespisan
    • tomas2400
    • devleonardomrabelo
    • brayanacebo
    • michaelrl
    • oscardrt
    • oscardev
    • jjuan1k94
    • brunomacedo