npm.io
1.0.4 • Published 5 years ago

file-based-database-shop

Licence
MIT
Version
1.0.4
Deps
0
Size
8 kB
Vulns
0
Weekly
0

file-based-database-shop


Warehouse manager using fs module.

Install


Install with npm.
npm install file-based-database-shop
Example Setup

After installing via npm, simply require the library and begin enjoying

// In your app.js file
const Shop = require('file-based-database-shop')
Usage

After requiring add these line of codes into your project

let keys = process.argv

;(async function () {
    let db = new Shop("warehouse");

    if (keys[2] === "--dep") {
        await db.dep(keys[3], parseInt(keys[4]));
    } else if (keys[2] === "-sell") {
        await db.sell(keys[3], parseInt(keys[4]));
    } else if (keys.length === 2) {
        await db.dash();
    }
})();
What features does our function have?

You can add products, sell products and see stats as table.

  • To add products run this command on your terminal or cmd:
node app.js --dep productName productCount

For example: image

  • To sell products run this command on your terminal or cmd:
node app.js -sell productName productCount

For example: image

  • To see existing products run this command on your terminal or cmd:
node app.js

For example: image

My github profile
GitHub
My telegram blog
Telegram

Keywords