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

text-compiler

v0.3.0

Published

Execute small algorithms written in natural language, pseudocode, flow-style instructions, or any human-friendly form

Readme

✨ textc (text-compiler)

NPM Version License: MIT Purpose: Pure Logic & Math Target: AI-Native IR

The AI-Native Compiler for Mathematical & Logical Algorithms.

Speak your algorithm in plain English • Compiled via AI-native IR • Executed with 100% mathematical precision.


🎯 Built for Logical & Mathematical Algorithms Only

Important by Design: textc is not a general-purpose programming language for building websites, UI, or mobile apps.

textc is a specialized, laser-focused algorithm compiler designed exclusively for:

  • 🔢 Mathematical calculations & sequences (Fibonacci, Collatz, factorials, GCD/LCM, powers, geometry).
  • 📊 Data analytics & statistics (averages, medians, standard deviations, filtering, finding extremes).
  • 🔄 Array transformations & sorting (in-place sorting, reversing, slicing, partitioning, swapping).
  • 🧩 Logical problem solving & puzzles (graph/path steps, conditionals, counting problems, simulation loops).

🤖 Engineered Specifically for AI

Traditional programming languages are designed for humans to type manually. textc’s Intermediate Representation (IR) is designed specifically for AI models:

  • 🧠 Zero Ambiguity: Strict, unambiguous grammar that eliminates AI syntax confusion and hallucinated keywords.
  • 🔒 Explicit Mutability (let vs mut): Enforces clear distinction between constants and changing state so AI-generated algorithms never corrupt memory.
  • ⚡ Pure Determinism: Translates fuzzy, probabilistic human language into exact, deterministic machine bytecode (.txtc).
flowchart LR
    A["🗣️ Human Speaks Logic\n('Find all primes under 50 and sum them')"] --> B["🤖 AI Emits TextC IR\n(Designed for AI precision)"]
    B --> C["📦 Standalone .txtc Bytecode\n(Compact, verified binary)"]
    C --> D["🎯 100% Exact Answer\n(Instant VM execution)"]

    style A fill:#7b1fa2,stroke:#ba68c8,color:#fff
    style B fill:#1565c0,stroke:#64b5f6,color:#fff
    style C fill:#2e7d32,stroke:#81c784,color:#fff
    style D fill:#d84315,stroke:#ff8a65,color:#fff

🚀 Quick Install

🐧 Linux, 🍏 macOS & 📱 Android Termux

curl -fsSL https://raw.githubusercontent.com/sapirrior/textc/main/installer/install.sh | bash

🪟 Windows (PowerShell)

irm https://raw.githubusercontent.com/sapirrior/textc/main/installer/install.ps1 | iex

📦 Via npm

npm install -g text-compiler

🌈 Write Algorithms in ANY Natural Text

textc understands your logic in whatever format feels natural:

1️⃣ Conversational Data Analysis

scores.txt:

I have test scores: [88, 92, 79, 95, 61, 84].
Sort them, remove the single lowest score, and calculate the average of the remaining ones.
Print the final average.
textc scores.txt --run
84

2️⃣ Step-by-Step Simulation & Finance Logic

investment.txt:

1. Start with 1000 dollars.
2. For 5 years in a row:
   - Grow the balance by 8% each year.
   - Add a 200 dollar bonus at the end of each year.
3. Print the final balance.
textc investment.txt --run
2637

3️⃣ Mathematical Sequences & Iteration

collatz.txt:

Start with the number 27.
If it is even, cut it in half.
If it is odd, multiply by 3 and add 1.
Repeat until you reach 1, and count how many steps it took.
Print the total step count.
textc collatz.txt --run
111

4️⃣ Data Extremes & Comparison

inventory.txt:

Prices: [45, 12, 89, 23, 67, 105, 34]
Find the cheapest item and the most expensive item.
Print the difference between the most expensive and cheapest items.
textc inventory.txt --run
93

5️⃣ Word & Symmetry Logic

palindrome.txt:

Given word letters: ["r", "a", "c", "e", "c", "a", "r"]
Reverse the letters and check if it spells the same word forwards and backwards.
Print true if it's a palindrome, false otherwise.
textc palindrome.txt --run
true

⚡ Why textc?

  • 🗣️ No Programming Knowledge Needed: Just express your logical thought or math problem.
  • 🎯 100% Deterministic: Mathematical precision with no hallucinated math.
  • ⚡ Lightning Fast: Precompiled .txtc program files execute in under 1 millisecond.
  • 📦 Standalone Binaries: Compile once and run offline anywhere with zero external dependencies.
  • 🛡️ Guaranteed Safe: Automatic bounds checking, safe math, and memory protection built into the VM.

⚙️ Configuration

Set your AI credentials once:

export TEXTC_BASE_URL="https://api.openai.com/v1"
export TEXTC_API_KEY="your-api-key"
export TEXTC_MODEL_NAME="gpt-4o-mini"

🛠️ Handy Commands

# Compile and run your plain-text file in one go:
textc my_algorithm.txt --run

# Compile your natural text into a shareable .txtc bytecode binary:
textc my_algorithm.txt

# Run a saved .txtc binary instantly (offline, 0 tokens, 0ms):
textc my_algorithm.txtc

# View the AI-native Intermediate Representation (IR):
textc my_algorithm.txt --emit-ir

📜 License

Distributed under the MIT License. Built for the future of AI-driven algorithmic computing.