UNPKG

termicalc

Version:

A simple calculator that runs in the terminal

130 lines (88 loc) 2.76 kB
# Termicalc [![npm version](https://img.shields.io/npm/v/termicalc.svg)](https://www.npmjs.com/package/termicalc) [![Downloads](https://img.shields.io/npm/dm/termicalc.svg)](https://www.npmjs.com/package/termicalc) [![License](https://img.shields.io/npm/l/termicalc.svg)](https://github.com/Essien-Emmanuel/termicalc/blob/main/LICENSE) [![Node.js Version](https://img.shields.io/node/v/termicalc.svg)](https://nodejs.org) > A lightweight, powerful terminal-based calculator with real-time evaluation capabilities. ## 🚀 Features - ✨ Real-time calculation as you type - 🔢 Basic arithmetic operations (+, -, *, /, ^) - 📊 Parentheses support for operation precedence - 🔍 Decimal number precision - 💻 Clean and minimal CLI interface - 🖱️ Access via `tc` or `termicalc` commands ## 📦 Installation Install globally via npm: ```sh npm install -g termicalc ``` ## 🎯 Quick Start After installation, you can start the calculator by typing: ```sh termicalc # or use the shorthand tc ``` ## 📖 Usage ### Basic Operations ```sh > 2 + 2 = 4 > (3 + 2) * 4 = 20 > 2.5 * 3 = 7.5 ``` ### Keyboard Controls | Key | Action | |-----------|-----------------------| | `q` | Quit application | | `Ctrl+C` | Exit calculator | | `Enter` | Evaluate expression | ## 🛠️ Development ### Prerequisites - Node.js (>= 18.x) - npm (>= 9.x) ### Local Setup 1. Clone the repository: ```sh git clone https://github.com/Essien-Emmanuel/Termicalc.git cd Termicalc ``` 2. Install dependencies: ```sh npm install ``` ### Scripts - Start the calculator in development mode: ```sh npm run calc ``` - Build the project: ```sh npm run build ``` - Run tests: ```sh npm test ``` ## 🤝 Contributing Contributions are welcome! Please follow these steps: 1. Fork the repository 2. Create your feature branch (`git checkout -b feature/amazing-feature`) 3. Commit your changes (`git commit -m 'Add some amazing feature'`) 4. Push to the branch (`git push origin feature/amazing-feature`) 5. Open a Pull Request See [CONTRIBUTING.md](CONTRIBUTING.md) for more details. ## 📄 License This project is licensed under the ISC License - see the [LICENSE](LICENSE) file for details. ## 👤 Author **Emmanuel Essien** - GitHub: [@Essien-Emmanuel](https://github.com/Essien-Emmanuel) - npm: [termicalc](https://www.npmjs.com/package/termicalc) ## 🌟 Show your support Give a ⭐️ if this project helped you! ## 📝 Changelog See [CHANGELOG.md](CHANGELOG.md) for release history. --- _This README was generated with ❤️_