1.0.10 • Published 6 years ago

fake-e-commerce v1.0.10

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

E-commerce simulator

a simple package with functions to manage a product array

Install

$ npm install fake-e-commerce

Usage

var products = require('fake-e-commerce');

Get all the products from your array with get().

products.get();

Get a product by id with getProductById(id).

products.getProductById(id);

Add a new product with addProduct(name, quantity, price). The package will automatically assign an id to the new product.

products.addProduct(name, quantity, price);

Delete a product by id with deleteProduct(id).

products.deleteProduct(id);

Buy a product by id product and token with buy(id, token). The package will automatically assign an id to the new product. later through the api you can manage the permissions.

products.buy(id, token);

Modify a product with updateProduct(name, quantity, price). you can modify even just one of the properties.

products.updateProduct(name, quantity, price);

Get all sales products with soldProducts() .

products.soldProducts();

Get all products bought by an user through his token soldProducts() .

products.getSalesByToken(token);

Reset original product array with reset().

products.reset();
1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago