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

rbx-tsx

v0.4.1

Published

TSX to Luau compiler targeting react-lua for Roblox

Readme

rbx-tsx

TSX/TypeScript → Luau compiler targeting react-lua for Roblox. Write React components in TypeScript/TSX, get clean, fully typed, dependency-free Luau that works inside Roblox.

📖 Documentation  ·  🛝 Playground

Why rbx-tsx?

Unlike roblox-ts, rbx-tsx compiles to standalone Luau with no runtime dependency and preserves your TypeScript types as Luau type annotations. JSX is built in (no @rbxts/* packages or tsconfig.json JSX setup), HTML elements map to Roblox GUI classes automatically, and JS APIs (console, Math, JSON, Array, RegExp, …) are inlined directly into the output.

See the full comparison in the docs.

Quick Start

npm install rbx-tsx

rbx-tsx init my-app        # scaffold a Rojo-ready project
cd my-app
rbx-tsx compile src/ -o out/

Example

Input (Counter.tsx):

import React, { useState, useCallback } from "react";

export default function Counter({ label }: { label: string }) {
  const [count, setCount] = useState(0);
  const increment = useCallback(() => setCount((c) => c + 1), []);

  return (
    <div className="counter">
      <h1>{label}</h1>
      <span>Count: {count}</span>
      <button onClick={increment}>+</button>
    </div>
  );
}

Output (Counter.luau):

const React = require(game:GetService("ReplicatedStorage").Packages.React)
const useState = React.useState
const useCallback = React.useCallback

const function Counter(props: { label: string })
    const label = props.label
    const count, setCount = useState(0)
    const increment = useCallback(function()
        setCount(function(c) return c + 1 end)
    end, {})

    return React.createElement("Frame", { [React.Tag] = "counter" }, {
        H1 = React.createElement("TextLabel", { Text = label }),
        Span = React.createElement("TextLabel", { Text = `Count: {count}` }),
        Button = React.createElement("TextButton", {
            [React.Event.Activated] = increment,
            Text = "+",
        }),
    })
end

return Counter

Try it live in the Playground, or browse examples/ for side-by-side input/output pairs (async/await, decorators, generators, optional chaining, regex, Roblox services, types). The demo/ directory is a full Rojo + Wally project.

CLI

rbx-tsx compile <input>   # compile a file or directory (stdout or -o <path>)
rbx-tsx watch <path>      # recompile on change
rbx-tsx check <input>     # type-check without emitting
rbx-tsx init <name>       # scaffold a new project
rbx-tsx types [path]      # generate .d.ts from wally/pesde packages or local .luau modules

Directory compilation and watch also copy hand-written .lua/.luau files into the output tree, so -o out/ produces a complete Rojo tree. Copies are verbatim — same relative path and name (the index.luauinit.luau rename applies only to compiled sources; name a hand-written init init.luau directly). .test./.spec. files, .d.luau/.d.lua declarations, and anything inside the output directory are skipped, and a hand-written file that collides with a compiled output is skipped with a warning.

Full flag reference and feature details are in the docs:

Contributing

The docs site lives in docs-site/ (Astro Starlight) and the in-browser playground in playground/. See CLAUDE.md for the compiler architecture.

License

MIT