npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pranavkok/mathterm

v1.3.12

Published

A simple math calculator that runs right in your terminal. No browser, no app — just type a command and get your answer instantly.

Downloads

497

Readme

mathterm

A simple math calculator that runs right in your terminal. No browser, no app — just type a command and get your answer instantly.

Installation

npm install -g @pranavkok/mathterm

Usage

Once installed, just run:

mathtermcli

You'll see a prompt like this:

Calculating ...
mathterm >

From here, type any math command and hit enter.

Commands

| Command | What it does | Example | |---|---|---| | add | Adds all the numbers | add 5 10 3 → 18 | | sub | Subtracts from the first number | sub 20 4 1 → 15 | | mul | Multiplies all the numbers | mul 2 3 4 → 24 | | div | Divides the first number by the rest | div 100 5 2 → 10 | | solve | Evaluates any math expression | solve 2 + 3 * 4 → 14 | | percentage | Finds what percent one number is of another | percentage 10 100 → 10 | | rand | Generates a random number (0–100 or min–max) | rand 1 6 → random 1–6 | | convert | Converts between units | convert 100 cm m → 1 | | help | Shows all available commands | help | | done | Exits the program | done |

Supported Units

| Category | Units | |---|---| | Length | mm, cm, m, km, in/inch, ft/foot, yd/yard, mile | | Weight | mg, g, kg, ton, oz, lb | | Volume | ml, l/liter/litre, gal/gallon, qt/quart, pt/pint, cup, floz | | Time | ms, s/sec, min, hr/hour, day, week, month, year | | Temperature | c/celsius, f/fahrenheit, k/kelvin |

You can convert between any two units in the same category — e.g. convert 5 km mile, convert 100 f c, convert 2 hr min.

Example Session

Calculating ...
mathterm > add 10 20 30
Answer is 60
mathterm > sub 100 25 15
Answer is 60
mathterm > mul 3 4
Answer is 12
mathterm > div 200 4
Answer is 50
mathterm > solve 2 + 3 * 4
Answer is 14
mathterm > solve (10 + 5) / 3
Answer is 5
mathterm > percentage 20 80
Answer is 25
mathterm > rand 1 10
7
mathterm > convert 100 cm m
Answer is 1
mathterm > convert 5 km mile
Answer is 3.106855961174092
mathterm > convert 212 f c
Answer is 100
mathterm > convert 2 hr min
Answer is 120
mathterm > convert 5 kg lb
Answer is 11.023113109243878
mathterm > convert 1 gal l
Answer is 3.78541
mathterm > done
Goodbye!

Notes

  • You can pass more than two numbers to any command — it'll chain the operation across all of them
  • Use solve for complex expressions with parentheses, operator precedence, decimals, etc.
  • Use percentage to quickly find what percent a part is of a whole (it computes (part / whole) * 100)
  • Use rand to generate random numbers — run rand alone for 0–100, or rand <min> <max> for a custom range (e.g. rand 1 6 for dice)
  • convert supports any-to-any conversion within the same category (Length, Weight, Volume, Time, Temperature)
  • Temperature conversions use proper formulas (not just ratios), so convert 32 f c gives you exactly 0
  • Type help anytime if you forget the commands
  • Type done when you're finished — it'll say goodbye :)

License

ISC