@edeveloper132-ilyas/atmsystem
v1.0.15
Published
ATM system
Maintainers
Readme
ATM Simulation CLI ⭐️
A fully interactive, terminal‑based ATM simulator with PIN management, transactions, balance inquiry, and integration hooks. Perfect for demos, teaching, or embedding in larger CLI tools.
📋 Table of Contents
✨ Features
🔒 PIN Management
- Setup: Create a secure 3‑digit PIN (100–999).
- Change: Verify old PIN before updating.
- Recovery: Reset PIN via your registered 13‑digit CNIC/NIC.
💰 Transactions
- Deposit: Minimum ₹500 per transaction.
- Withdraw: Withdraw up to your balance; maintain a minimum ₹100.
📊 Balance Inquiry
- Instantly view your current balance.
🔄 Integration Hooks
onExit(callback): Run custom logic when ATM session ends.
🎨 Customizable
- Programmatic functions
plusBalance&minusBalancefor advanced demos.
- Programmatic functions
🚀 Installation
Install from npm under your scope:
npm install @edeveloper132-ilyas/atmsystemOr add as a project dependency:
yarn add @edeveloper132-ilyas/atmsystemRequires Node.js v14 or higher. Ensure your terminal supports modern ANSI colors.
💻 Usage
Programmatic API
Import and embed the ATM in any Node.js application:
import { ATM, getBalance, plusBalance, minusBalance, onExit, NIC } from "@edeveloper132-ilyas/atmsystem";
// Optional: Hook to run after ATM session completes
onExit(() => {
console.log("🔄 Returned from ATM to host application. Final balance:", getBalance());
});
// Launch interactive ATM
await ATM();CLI Invocation
Use npx or your local binary to start the ATM directly:
# via npx
npx @edeveloper132-ilyas/atmsystem
# if installed globally
atmsystem📝 Examples
1️⃣ Full Session
$ npx @edeveloper132-ilyas/atmsystem
|||||||||||||||| WELCOME TO OUR BANK'S ATM ||||||||||||||||||||||
? Please enter your NIC Number here: 3210123456789
? Please enter your new PIN here: 123
✔ Your PIN 123 has been set successfully!
? Select an action:
❯ Deposit Amount
Withdraw Amount
Check Balance
Manage PIN
Exit
# Deposit ₹1000
? Enter deposit amount: 1000
✔ Amount deposited: ₹1000
ℹ Current balance: ₹1000
# Withdraw ₹400
? Enter withdrawal amount: 400
✔ Amount withdrawn: ₹400
ℹ Current balance: ₹600
# Recover PIN
? Manage PIN -> Recover PIN
? Enter your CNIC: 3210123456789
✔ Verification successful!
? Enter your new PIN: 321
✔ PIN updated successfully!
# Exit
Thank you for using our ATM service!
Goodbye 👋⚙️ Configuration
No external config files required. All settings are in‑memory and reset per session.
Tip: Use
plusBalanceandminusBalancein tests to simulate initial bank balance.
🔗 API Reference
| Member | Type | Description |
| ---------------------- | ----------------------- | ---------------------------------------------------- |
| ATM() | Promise<void> | Launch interactive ATM CLI. |
| getBalance() | (): number | Get current balance. |
| plusBalance(amount) | (n: number) => number | Increase balance programmatically (for demos/tests). |
| minusBalance(amount) | (n: number) => number | Decrease balance programmatically. |
| NIC | number | Registered 13‑digit CNIC/NIC of the user. |
| onExit(callback) | `(fn: () => void | |
| Register a hook when ATM session ends. |🏷️ Keywords
keywords:
- atm
- bank
- cli
- simulation
- pin
- cnic
- nic
- nodejs
- typescript
- demo🤝 Contributing
Love this project? Please contribute:
- Fork the repo
- Clone:
git clone https://github.com/eDeveloper132/ATM_SYSTEM.git - Branch:
git checkout -b feature/YourFeature - Commit:
git commit -m "Add YourFeature" - Push:
git push origin feature/YourFeature - PR: Open a Pull Request against
main
Follow the code style and include tests for any new functionality.
🛡️ License
Distributed under the MIT License. See LICENSE for details.
📫 Contact
👤 Muhammad Ilyas
- GitHub: edeveloper132-ilyas
- npm: edeveloper132-ilyas
Crafted with ❤️ and ☕
