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

jambda-calc

v0.6.1

Published

Convert JavaScript functions to the Lambda Calculus, and visualize them with Tromp diagrams.

Readme

Welcome to jambda-calc

An npm package for transpiling JS/TS into λ calculus, and visualizing expressions with Tromp Diagrams.

Lambda calculus is one of the most simple Turing-complete languages, meaning that theoretically any valid programmatic function can be transpiled from it's native language, into a lambda expression.

In lambda calculus, everything is considered a function and creates the computation

Turing complete, simple language. Everything is a fn. Link to vid Vision is to process entire js projects into diagrams


Transpiler Functionality:

transpiler image

The transpiler (for converting JS/TS code into lambda calc), has handling for input files containing:

  • Arithmetic (+, -, /, *)
  • Common JS operators (!=, ==, ===)
  • Number/boolean literals (-100 to 100, true/false)
  • Conditionals (if else, switches)
  • Nested functions (defined in the same input file)
  • Basic member functions like .filter() and .map()

Not yet implemented:

  • String operations
  • Recursion
  • Async functions
  • let/var
  • Increment/decrement (SUCC)
  • Imported functions/modules from other files/dependencies
  • Other member functions (Math.cos(), Math.log()) - Get abstracted as ((λobj.λprop.obj prop) ${func} (λx.x))

Visualizer Functionality

visualizer image

The visualizer converts formal λ calculus into Tromp Diagrams.

  • Lambda abstractions (functions) are represented as horizontal lines across the top.
  • Variables (params) cross abstraction lines vertically.
  • Applications connect the bottom-left corners of terms being applied.

Installation

pnpm install jambda-calc

Note: Using pnpm for these examples, but npm works exactly the same.

CLI Usage

After installing in your project directory, you can use pnpm jambda-calc with various flags to run transpilation or visualization from the command line.

Helper Commands

pnpm jambda-calc examples - Run three example functions through transpilation and visualization.

pnpm jambda-calc --help - Display the options for flags.

Basic commands
  • pnpm jambda-calc -i path/to/input-file.js: Runs transpilation and visualization on an input file (required). Prints results to console.
  • pnpm jambda-calc -i path/to/input-file.js -t: Only run transpilation.
  • pnpm jambda-calc -i path/to/lambda-expression.txt -v: Only run visualization (input file containing lambda expression to visualize).
Flags
  • -i, --input: Input file to run transpilation or visualization on. (Required)
  • -o, --output: Output dir to save output files: lambda expression (.txt) and/or tromp diagram (.png). Prints in console if not specified.
  • -t, --transpile and -v, --visualize: Choose which task(s) to preform, if neither is specified, it runs both. If only visualize is set, it will expect a .txt input file containing an expression.
  • -f, --format: Specify the file extension of the tromp diagram being saved: png or svg.