A TypeScript-based command-line calculator that evaluates mathematical operations including basic arithmetic operations, scientific functions like factorial calculation and square root calculation, and complex mathematical expressions.
A simple basic TypeScript-based command-line calculator application for kindergartener, who wants to learn calculations. The application has the operations like addition, subsraction, multiplication, division, modulus, expinential calculation and advance operations like square root calculation and factroial.
# Clone the repository by running the below command in terminal.
git clone git@github.com:mohammed412anas/calculator.git
# Go into the project directory in your terminal or open the directory that you have cloned and open the terminal from this downloaded directory and run this command.
cd calculator
# Install dependencies in the project repo with the command.
npm install# To run the application in CLI run the command from the project directory.
npm run dev
# or
tsc && node dist/main.js- Basic arithmetic:
+,-,*,/,%,^or**. - Scientific functions:
sqrt(), factorial (!). - Numbers with quotes are automatically filtered.
# To test the code first go to the project directory if you are not in the project directory open the directory that you have cloned and open the terminal from this downloaded directory and run this command.
cd calculator
# To test the project run the below command.
npm run test
# To see the code coverage of the project run the below command in terminal.
npm run coverage
- Typescript
- NodeJs
prompt-sync: Interactive command-line input.mathjs: Mathematical expression evaluation.jest: Testing framework .ts-node: To automatically transpile and run Typescript file.
- Fork this repository to your own GitHub account.
- Clone your fork to your local machine.
- Create your feature branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -m 'feat: add your feature'). - Push to the branch (
git push origin feature/your-feature). - Open a Pull Request.
This project is licensed under the MIT License.
- Name – mohammed.anas@everest.engineering
- GitHub – mohammed412anas