file-based-stock-manager

Warehouse manager

Usage no npm install needed!

<script type="module">
  import fileBasedStockManager from 'https://cdn.skypack.dev/file-based-stock-manager';
</script>

README

Instruction

Installation

$ npm i file-based-stock-manager
$ yarn add file-based-stock-manager

First you should import package into your project.

Usage

You should copy and paste these codes to your main javascript file in order to use package

const Warehouse = require("file-based-stock-manager");

;(async () => {
    let warehouse = new Warehouse('warehouse');
    let argv = process.argv;
    if (argv[2] === '--dep') {
        await warehouse.dep(argv[3], argv[4]);
    } else if (argv[2] === '-sell') {
        await warehouse.sell(argv[3], argv[4]);
    } else if (argv[2] === '-restore') {
        await warehouse.restore(argv[3])
    } else if (argv.length === 2) {
        if (await warehouse.dash() == false) {
            await warehouse.noDash()
        }
    }
})()

You can do these 4 main operations:

  • Deposit:
node example.js --dep productName productCount

image

  • Sell:
node example.js -sell productName productCount

image

  • Restore:
node example.js -restore productName

image

  • Dashboard:
node example.js

image