whatisgithub

What is tsdx?

jaredpalmer/tsdx — explained in plain English

Analysis updated 2026-06-24

11,465TypeScriptAudience · developerComplexity · 2/5Setup · easy

In one sentence

A command-line tool that sets up and builds TypeScript packages for npm publishing, handling bundling, testing, linting, and formatting automatically so you can start writing code right away.

Mindmap

mindmap
  root((tsdx))
    What it does
      Scaffolds TS packages
      Handles bundling
      Configures tests
      Formats and lints
    Tech Stack
      TypeScript
      Bun runtime
      SWC and Rollup
      Vitest and oxlint
    Use Cases
      npm library setup
      React component lib
      Zero-config builds
    Output
      ESM format
      CommonJS format
      Type declarations
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Scaffold a new TypeScript library with a single command, getting bundling, tests, and linting pre-configured.

USE CASE 2

Build and publish a React component library to npm with ESM and CommonJS output and TypeScript declarations included.

USE CASE 3

Replace manual Rollup, Jest, and ESLint configuration with a zero-config build tool that produces production-ready npm packages.

What is it built with?

TypeScriptBunRollupSWCVitestoxlint

How does it compare?

jaredpalmer/tsdxmilkdown/milkdowngcanti/fp-ts
Stars11,46511,46711,510
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderatemoderate
Complexity2/53/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires Node.js 20 or newer and Bun installed on the machine.

So what is it?

TSDX is a command-line tool that handles the setup and build process for TypeScript packages that you want to publish to npm. The idea is that starting a new TypeScript library involves a lot of boilerplate: configuring a bundler, setting up tests, deciding on code formatting and linting rules, and making sure the package output works for both modern and older JavaScript environments. TSDX does all of that for you so you can start writing code immediately. Version 2.0 is a rewrite that swaps out the original tooling for faster alternatives. Bundling is handled by bunchee, which is built on top of Rollup and SWC. Testing uses vitest instead of Jest. Linting uses oxlint, described in the README as 50 to 100 times faster than ESLint. Formatting uses oxfmt. Package management relies on Bun. These are all Rust-based or Bun-native tools chosen for speed. When you create a new project with TSDX, it generates a standard folder structure with source files in src/, tests in test/, and build output in dist/. The build command produces two output formats automatically: ESM for modern bundlers and module-aware Node.js, and CommonJS for older environments. TypeScript declaration files are included in the output as well, so consumers of your library get type information without extra steps. The package.json exports field is configured automatically to point to the right file for each use case. Two project templates are available: a basic TypeScript library and a React component library. The React template includes a small demo application powered by Vite so you can develop and preview the component locally. Requirements are Node.js 20 or newer and Bun installed. People upgrading from the original version of TSDX need to follow a migration guide, since the tooling changed significantly between v0.x and v2.0.

Copy-paste prompts

Prompt 1
I'm using tsdx to build a TypeScript library. Show me how to create a new project, add an exported function, build it, and verify the ESM and CJS outputs are correct.
Prompt 2
Help me migrate my existing TypeScript npm package from tsdx v0.x to tsdx v2.0, covering the changes from Jest to vitest and from ESLint to oxlint.
Prompt 3
I'm using the tsdx React template. Show me how to set up a React component library with a local Vite-powered demo app for development preview.
Prompt 4
Explain how tsdx automatically configures the package.json exports field to route ESM and CommonJS consumers to the correct output file.

Frequently asked questions

What is tsdx?

A command-line tool that sets up and builds TypeScript packages for npm publishing, handling bundling, testing, linting, and formatting automatically so you can start writing code right away.

What language is tsdx written in?

Mainly TypeScript. The stack also includes TypeScript, Bun, Rollup.

How hard is tsdx to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is tsdx for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.