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

litholang

v0.1.3

Published

A programming language designed for LLM code generation — transpiles to TypeScript

Downloads

322

Readme

LithoLang

A programming language designed for LLM code generation — transpiles to TypeScript.

Litho uses English-like keywords, explicit types at boundaries, and a flat keyword...end block structure so that both humans and language models can read and generate code with minimal ambiguity.

Quick Start

npm install
npm run build

# Compile a .litho file to TypeScript
npm run litho -- compile examples/pipeline.litho

# Type-check without emitting
npm run litho -- check examples/pipeline.litho

Example

@purpose "Process daily sales and generate report"

define daily_report(date: Date) -> Result<Report, Error> as
  transactions = db.sales
    |> filter(where .date == date)
    |> filter(where .status == "completed")
    |> collect

  summary = transactions
    |> group(by .category)
    |> map(each group =>
        category: group.key,
        total: group.values |> sum(of .amount),
        count: group.values.length
      )
    |> sort(by .total, descending)

  return ok(Report(
    date: date,
    total_revenue: transactions |> sum(of .amount),
    transaction_count: transactions.length,
    by_category: summary,
    generated_at: now()
  ))
end

More examples in examples/.

Language Highlights

Pipelines as primary data flow:

data |> filter(where .active) |> map(each x => x.name) |> collect

Errors as values with Result<T,E> and ? propagation:

body = request.parse_json(as: NewUser)?

check body.password.length >= 8
  or return bad_request("Password too short")

Pattern matching:

match order.status on
  case Pending  => process_payment(order)
  case Shipped  => track_delivery(order)
  case _        => no_action()
end

Immutable updates:

updated = order with status: Paid

Tail recursion (@tailrec) compiled to while loops, and mutual recursion (@trampoline) compiled to thunk bouncing:

@tailrec
define factorial(n: Number, acc: Number) -> Number as
  if n <= 1 then
    return acc
  else
    return factorial(n - 1, n * acc)
  end
end

Semantic annotations that carry meaning:

@purpose "Compute factorial using tail-recursive accumulator pattern"
@invariant "n >= 0"
@example "factorial(5, 1) => 120"

Built-in Types

Text, Number, Boolean, Void, List<T>, Map<K,V>, Set<T>, Maybe<T>, Result<T,E>, Duration, Date, Timestamp

Architecture

.litho source → Lexer → Parser (AST) → Type Checker → Emitter → .ts output

| Stage | Location | Description | |-------|----------|-------------| | Lexer | src/lexer/ | Tokenizes source; keywords defined in tokens.ts | | Parser | src/parser/ | Hand-written recursive descent; AST nodes in ast.ts | | Type Checker | src/typechecker/ | Boundary type validation, local inference, tail recursion & trampoline analysis | | Emitter | src/emitter/typescript.ts | Walks AST, produces TypeScript output | | CLI | src/cli.ts | compile, check, fmt commands |

Development

npm test                # Run all tests
npm run test:watch      # Watch mode
npm run build           # Build with tsup (outputs to dist/)

Run a single test file or test by name:

npx vitest run tests/lexer.test.ts
npx vitest run -t "tokenizes pipeline operator"

License

ISC