@dev_sajid/calculator-cli
v1.0.0
Published
একটি সহজ **Command Line Calculator Application** যা Node.js ব্যবহার করে তৈরি করা হয়েছে। Terminal থেকে Addition, Subtraction, Multiplication এবং Division করা যায়।
Readme
🧮 Calculator CLI
একটি সহজ Command Line Calculator Application যা Node.js ব্যবহার করে তৈরি করা হয়েছে। Terminal থেকে Addition, Subtraction, Multiplication এবং Division করা যায়।
🚀 Features
- Addition (+)
- Subtraction (-)
- Multiplication (×)
- Division (÷)
- Command Line Arguments ব্যবহার
- Beginner Friendly Project
📁 Project Structure
calculator-cli/
│
├── app.js
└── README.md📦 Requirements
- Node.js Installed
Node.js Version Check:
node -v▶️ Run Project
Addition
node app.js add 10 20Output:
Result: 30Subtraction
node app.js sub 20 5Output:
Result: 15Multiplication
node app.js mul 5 4Output:
Result: 20Division
node app.js div 20 2Output:
Result: 10🧠 ব্যবহৃত Concepts
process.argv
Command Line থেকে Data গ্রহণ করার জন্য ব্যবহার করা হয়।
উদাহরণ:
node app.js add 10 20এখানে:
process.argv[2] // add
process.argv[3] // 10
process.argv[4] // 20Functions
প্রতিটি Operation আলাদা Function দিয়ে করা যায়।
function add(a, b) {
return a + b;
}Number Conversion
Command Line থেকে আসা Data String হিসেবে আসে।
Number("10")অথবা
parseInt("10")🎯 Learning Goals
এই Project শেষ করার পর তুমি শিখবে:
- Node.js Basics
- Command Line Arguments
- Functions
- Conditional Statements
- Type Conversion
- Project Structure
🔥 Future Improvements
নিচের Features গুলো নিজে যোগ করার চেষ্টা করো:
Power
node app.js power 2 3Output:
Result: 8Modulus
node app.js mod 10 3Output:
Result: 1Square Root
node app.js sqrt 25Output:
Result: 5Help Command
node app.js helpOutput:
Available Commands:
add
sub
mul
div
power
mod
sqrt📚 Author
এই Project টি Node.js Beginners দের জন্য তৈরি করা হয়েছে যাতে তারা Command Line Applications তৈরি করা শিখতে পারে।
