1.0.0 • Published 6 years ago

fake-eshop-api v1.0.0

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

get fake eshop (buying/edit/delete products)

Installation

npm install fake-eshop-yk

Usage

For use fake products

var fakeProducts = require('fake-products-sj');  // required file to  this npm 

fakeProducts.addProduct({name:'Iphone 3G', amount: 2}); //add product ({name:x,amount:y}) --> JSON form
fakeProducts.getProducts(); //show all product
fakeProducts.deleteProducts(1); //delete product at id=1
fakeProducts.editProducts(1, 'Iphone X plus', 100);   //edit product at id 1 and change his name and his qty to iPhone X plus - 100 qty
fakeProducts.buyProduct(1, 'my_id'); //Buy product at id=1
fakeProducts.getHistorySell(); //show all purchases