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

@teaklang/teak

v0.0.2

Published

Teak is a Kotlin-inspired scripting language that runs on Node.js

Readme

Teak

A Kotlin-inspired scripting language that runs on Node.js. Write .tk scripts and run them directly, or compile them to JavaScript.

Documentation: teak-lang.aawadia.dev

Install

npm i @teaklang/teak

Or run directly with npx:

npx @teaklang/teak your-script.tk

Quick Start

Write a Teak script:

// hello.tk
println("Hello from Teak!")

val nums = listOf(1, 2, 3, 4, 5)
val doubled = nums.map { it * 2 }
println(doubled)

Run it:

teak hello.tk

Compile it to JavaScript:

teakc hello.tk > hello.js
node hello.js

Language Basics

Variables

val name = "teak"    // immutable
var count = 0        // mutable
count += 1

Functions

fun add(a, b) = a + b

fun greet(name = "Guest") = "Hello, $name!"

println(greet())      // Hello, Guest!
println(greet("Ada")) // Hello, Ada!

Data Classes

data class Point(x, y)

fun (p Point) distanceTo(other) =
  sqrt((p.x - other.x) * (p.x - other.x) +
       (p.y - other.y) * (p.y - other.y))

val a = Point(0, 0)
val b = Point(3, 4)
println(a.distanceTo(b))  // 5

Control Flow

val max = if (a > b) a else b

when (code) {
  200      -> println("OK")
  404      -> println("Not found")
  else     -> println("Unknown")
}

for (i in 1..10) println(i)

var i = 0
while (i < 5) {
  i += 1
}

Collections

val nums = mutableListOf(3, 1, 4, 1, 5)

nums.add(9)
println(nums.sorted())          // [1, 1, 3, 4, 5, 9]
println(nums.filter { it > 3 }) // [4, 5, 9]
println(nums.fold(0) { acc, v -> acc + v })

val counts = listOf("a", "b", "a").groupBy { it }
println(counts)  // {a: [a, a], b: [b]}

HTTP Server

val server = HttpServer(3000)

server.get("/") {
  it.html("<h1>Hello from Teak!</h1>")
}

server.get("/users/:id") {
  val id = it.params.get("id")
  it.json(mutableMapOf("userId" to id))
}

server.post("/users") {
  it.status(201).json(mutableMapOf("created" to it.body.name))
}

server.start()

File Processing

File("server.log").readLines()
  .filter { it.includes("ERROR") }
  .take(20)
  .forEach { println(it) }

Commands

| Command | Description | | ----------------- | ----------------------------------- | | teak <file.tk> | Run a Teak script | | teakc <file.tk> | Compile a Teak script to JavaScript |

Examples

See the examples/ directory for comprehensive, runnable examples of every language feature:

| File | What it covers | | --------------------------- | ------------------------------------------------------------- | | 01-hello-world.tk | The basics — println and comments | | 02-variables-and-types.tk | val/var, immutability, types | | 03-functions.tk | Functions, lambdas, default params, recursion | | 04-control-flow.tk | if/else, when, for-in, while, break, continue | | 05-strings.tk | Interpolation, string methods, triple-quoted strings | | 06-data-classes.tk | Data classes, default fields, receiver functions | | 07-lists.tk | Immutable/mutable lists, functional ops, slicing, sorting | | 08-sets.tk | Sets, set operations (union, intersect, subtract) | | 09-maps.tk | Maps, to operator, functional ops | | 10-sequences.tk | Lazy sequences, pipeline operations | | 11-file-io.tk | File read/write/append/copy/delete, directory ops, JSON | | 12-http-server.tk | HTTP server with routing, middleware, path/query params | | 13-concurrency.tk | go {}, channels, wait groups | | 14-recursion.tk | Recursive algorithms — sum, tree leaves, quicksort, GCD |

Run any example with:

teak examples/03-functions.tk

License

MIT