file-based-stock-manager
v1.0.10
Published
Warehouse manager
Downloads
16
Maintainers
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
- Sell:
node example.js -sell productName productCount
- Restore:
node example.js -restore productName
- Dashboard:
node example.js