Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

entreprenerd-demo-math

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

entreprenerd-demo-math

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

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 26 Jan 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc