mrshas-cli-simple-calculator
v1.0.5
Published
This is a simple calculator CLI built in typescript with Node.js using inquirer and chalk. It supports addition, subtraction, multiplication, and division.
Downloads
6
Maintainers
Readme
CLI Simple Calculator: 🧮
This project is a simple command-line calculator built in TypeScript using the inquirer library for user input.
Features: 🌟
Interactive Interface: The calculator provides a user-friendly interface where users can input numbers and select the desired operation.
Error Handling: It gracefully handles invalid inputs, preventing crashes or unexpected behavior.
TypeScript: The entire project is written in TypeScript, ensuring type safety and better code quality.
Prerequisites: 🛠️
Before running the calculator, ensure you have the following installed:
Node.js: To run the game, you’ll need Node.js installed on your system. You can download it from https://nodejs.org.
TypeScript: The game is written in TypeScript, so you’ll need to install TypeScript. Use the following command in your terminal:
npm install -g typescript
Installation: 🚀
Clone this repository to your local directory:
git clone https://github.com/HasnainDevMaster/CLI-Simple-Calculator.git
Install the dependencies by running the following command in your terminal (cmd):
npm install
Additionally, install inquirer for user input prompts:
npm i inquirer
Installation: NPM:
Simply run the following command in your terminal (cmd):
npx mrshas-cli-simple-calculator
When prompted to install npm packages, press "y" to continue.
Example: 🎯
Enter first number: 10
Enter second number: 20
Select one of the operators to perform action: "Addition"
Result: 30
Do you want to perform another calculation? (yes/no) "Yes"
Enter first number: 15
Enter second number: 10
Select one of the operators to perform action: "Subtraction"
Result: 5
Do you want to perform another calculation? (yes/no) "No"
Thank you for using the calculator!
Note: 📝
Make sure you have Node.js installed on your machine to run this application. This calculator only accepts integers as input. Supported basic arithmetic operations: addition, subtraction, multiplication, and division.
Happy coding! 🚀