entreprenerd-demo-math

1.1.0 • Public • Published

The Math Package

This math package will be used to build an ecommerce Having a math package allows you to reuse the code in both frontend and backend You can also unit test this code, which is most likely the most important code you're writing

Installation

yarn add entreprenerd-demo-math

Usage

const { getPrice } = require("entreprenerd-demo-math");
const price = getPrice({price: 1})
console.log("price", price)

Methods

getPrice(product)

Given a product, return it's price

getQuantity(product)

Given a product in a cart, return it's quantity

getTotal(cart)

Given a cart, return the total cost of the products it contains

Readme

Keywords

none

Package Sidebar

Install

npm i entreprenerd-demo-math

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

1.03 MB

Total Files

47

Last publish

Collaborators

  • gallodasballo