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 🙏

© 2025 – Pkg Stats / Ryan Hefner

numtap

v1.2.1

Published

CLI calculator with scientific functions and interactive mode

Readme

Numtap - Command-Line Scientific Calculator

License: GPL-3.0 Node.js: >=14 npm Downloads Size

Numtap is a powerful, lightweight command-line calculator designed for precision and speed in scientific computations. Tailored for developers, engineers, and math enthusiasts, it offers both quick evaluations and an enriched interactive REPL experience, all within the terminal. With enhanced unit conversions, full multilingual support, and robust error handling, Numtap is your go-to tool for terminal-based calculations.


Table of Contents


Overview

Numtap combines a streamlined architecture with a rich feature set, powered by a customized mathjs core. Whether you need a quick result or a persistent calculation session, Numtap delivers with minimal overhead and maximum utility. It supports advanced scientific functions, unit conversions, and a fully multilingual interface—perfect for professionals and hobbyists alike.


Prerequisites

  • Node.js: Version 14.0.0 or higher (download from nodejs.org).
  • npm: Included with Node.js installation.

Installation

Install Numtap globally via npm:

npm install -g numtap

Dependencies: chalk, commander, figlet, mathjs.

For source installation:

git clone https://github.com/AbdeslamChouimet/numtap.git
cd numtap
npm install
npm link

Quick Start

  1. Install Numtap:
    npm install -g numtap
  2. Try a quick calculation:
    numtap "5 + 3"
  3. Explore interactive mode:
    numtap
    Then type .help for commands (available in your chosen language).

Usage

Numtap supports two modes to fit your workflow:

1. Quick Mode

Evaluate a single expression instantly:

numtap "2 + 3 * (4 - 1)"

Output:

Result: 11
Time taken: 9.12 ms

2. Interactive Mode

Launch a REPL session for continuous calculations:

numtap

Example session:

➤ x = 5
➤ y = x + 2
➤ y * sin(30 deg)
= 3.5
Time taken: 8.45 ms
➤ .exit
Goodbye! Total calculations: 1

Commands (Interactive Mode)

In interactive mode, use these commands:

  • .help, .h: Display available commands.
  • .clear, .cls: Clear the terminal screen.
  • .last, .l: Show the last result.
  • .history, .his: View calculation history with timestamps.
  • .version, .v: Display version.
  • .exit, .q: Exit the session.

Supported Operations and Features

1. Arithmetic Operations

| Operation | Symbol/Function | Example | Result | |----------------|-----------------|-----------------|--------| | Addition | + | 5 + 3 | 8 | | Subtraction | - | 7.2 - 2 | 5.2 | | Multiplication | * | 4 * 2.5 | 10 | | Division | / | 10 / 4 | 2.5 |

2. Scientific Functions

| Category | Functions | Example | Approx. Result | |----------------|----------------------------------------|-----------------|----------------| | Trigonometric | sin(), cos(), tan() | sin(90 deg) | 1 | | Logarithmic | log(base, value), log10(), exp() | log10(100) | 2 |

3. Unit Conversions

| Conversion | Example | Result | |----------------|-----------------------|----------------| | Distance | 2 km to meter | 2000 meter | | Temperature | 25 degC to degF | 77 degF | | Volume | 2 liter to gallon | 0.528344 gallon|


Command-Line Interface Options

  • -v, --version: Show version number.
  • -h, --help: Display usage and examples.
  • -l, --lang <language>: Set language for output and interactive mode.

Supported languages: | Language | Code | Example Output | |------------|------|----------------------| | English | en | Result: 8 | | Arabic | ar | النتيجة: 8 | | Russian | ru | Результат: 8 | | French | fr | Résultat: 8 | | Spanish | es | Resultado: 8 | | German | de | Ergebnis: 8 | | Portuguese | pt | Resultado: 8 |

Example:

numtap --lang ar

Output: مرحبًا بك في Numtap! اكتب ".help" للحصول على الأوامر


Technical Design

  • Core: Optimized mathjs with matrix: false and number: 'number' for speed.
  • Output: Color-coded with chalk and styled with figlet in interactive mode.
  • State: Persistent scope object for variable storage.
  • Performance: Lazy loading and pre-initialization reduce startup time to <50ms for most operations.

Examples of Use

  • Quick calculation: numtap "5^2 - 3 * 4"Result: 13
  • Unit conversion: numtap "25 degC to degF"Result: 77 degF
  • Interactive: numtap➤ pi * 3^2= 28.274333882308138

Error Handling

Numtap provides clear, multilingual error messages:

  • Syntax error: numtap "5 + * 3"Error: Syntax error
  • Undefined symbol: numtap "x + 2"Error: Undefined symbol

Compatibility

  • Linux: Fully supported.
  • macOS: Terminal-compatible.
  • Windows: Works via CMD, PowerShell, or WSL.

Limitations

  • No complex number support.
  • Matrix operations excluded for efficiency.

Roadmap

Future enhancements include:

  • Multilingual command aliases (e.g., .aide for French).
  • More unit conversions (e.g., time, mass).
  • Optional complex number arithmetic.
  • Custom user-defined functions.

Contributions

Contributions are welcome:

  1. Fork: github.com/AbdeslamChouimet/numtap.
  2. Submit pull requests.
  3. Report issues: GitHub Issues.

License

Licensed under the GNU General Public License v3.0.


Author

Developed by Abdeslam Chouimet.


Numtap: Precision, power, and simplicity—crafted for the terminal.