boosted-calc
Version:
A powerful terminal-based calculator with unit conversions, currency support, and more
150 lines (109 loc) ⢠3.6 kB
Markdown
# Boosted Calculator
A powerful terminal-based calculator inspired by Numi, built with TypeScript and Ink (React for CLI). Features arbitrary precision arithmetic, advanced math operations, unit conversions, dimensional analysis, live currency conversion, and more.

## Installation
### Install from npm (recommended)
```bash
npm install -g boosted-calc
# or
yarn global add boosted-calc
# or
bun add -g boosted-calc
```
### Build from source
```bash
# Clone the repository
git clone https://github.com/pyboosted/calc
cd calc
# Install dependencies
bun install
# Install globally
npm link
```
## Quick Start
```bash
# Run the calculator (interactive mode)
calc
# Open or create a calculation file
calc budget.calc
# Evaluate expression directly
calc -e "2 + 2"
calc -e "100 USD in EUR"
calc -e "sqrt(16) * 2"
# Update currency exchange rates
calc --update
```
### Basic Examples
```
# Simple math
2 + 2 # 4
10 * (5 + 3) # 80
sqrt(144) # 12
# Unit conversions
100 cm in meters # 1 m
32 °F in °C # 0 °C
60 km/h to m/s # 16.667 m/s
# Compound unit input
1h 30min # 1.5 hours
2kg300g # 2.3 kg
100m / 1min30s # 66.67 m/min
# Variables and functions
radius = 5
area = pi * radius^2 # 78.54
double(x) = x * 2
double(10) # 20
# Pipe operator
[1, 2, 3, 4, 5] | sum # 15
" hello " | trim | len # 5
# Date calculations
today + 7 days
25/12/2024 - today in days
```
## Features
- š¢ **Arbitrary Precision** - Decimal.js for exact calculations (v1.5.0)
- ⨠**Advanced Mathematics** - Functions, trigonometry, logarithms
- š **Unit Conversions** - Length, weight, temperature, time, volume, data
- ā” **Dimensional Analysis** - Compound units like m/s, kgā
m/s² (Newton)
- š± **Live Currency** - 300+ currencies with daily updates
- š
**Date & Time** - Arithmetic with dates, timezone support
- š¤ **Strings & Booleans** - Text manipulation, logical operations
- š **Arrays & Objects** - First-class data structures
- š§ **Variables & Functions** - User-defined functions with recursion
- šÆ **Lambda Expressions** - Anonymous functions, higher-order operations
- š **Pipe Operator** - Functional composition with `|` operator
- šØ **Smart Interface** - Syntax highlighting, history, multi-line support
- š **Markdown Support** - Rich text formatting for invalid expressions (v1.5.3)
[ā View all features](docs/features.md)
## Documentation
- š [Complete Examples](docs/examples.md) - Comprehensive usage examples
- ā” [Features Guide](docs/features.md) - Detailed feature documentation
- āØļø [Keyboard Shortcuts](docs/keyboard-shortcuts.md) - Navigation and editing
- āļø [Configuration](docs/configuration.md) - Settings and customization
- šļø [Architecture](docs/architecture.md) - Technical design and internals
- š [Breaking Changes](docs/breaking-changes.md) - Migration guides
## Development
This project uses Bun as the package manager and development runtime, but is distributed as a standard Node.js package.
```bash
# Install dependencies
bun install
# Run tests
bun test
# Run development mode with hot reload
bun dev
# Build for distribution
bun run build
# Type checking
bun run typecheck
# Linting
bun run lint
```
### Publishing
The package is automatically built before publishing:
```bash
npm publish
```
## Requirements
- Node.js 18+ (for runtime)
- Bun (for development only) - [Install Bun](https://bun.sh)
## License
MIT