1.0.0 • Published 7 years ago
fake-eshop-api v1.0.0
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
1.0.0
7 years ago