file-based-database-shop

Shop made with fs module

Usage no npm install needed!

<script type="module">
  import fileBasedDatabaseShop from 'https://cdn.skypack.dev/file-based-database-shop';
</script>

README

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