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

typerd

v0.0.5

Published

CLI development tools for building and running TypeScript projects

Readme

typerd

CLI development tools for building and running TypeScript projects with support for both TSC and SWC compilers.

Features

  • Dual Compiler Support — Use TypeScript's native compiler (TSC) for full type checking, or SWC for blazing-fast compilation
  • Watch Mode — Automatic recompilation and restart on file changes with intelligent debouncing
  • Type Checking — Run type checking in parallel with SWC compilation for the best of both worlds
  • Declaration Files — Generate .d.ts files with SWC using TSC under the hood
  • Debug Support — Built-in --inspect and --inspect-brk flags with custom host:port configuration
  • Path Alias Resolution — Automatic resolution of tsconfig path aliases in compiled output
  • Source Maps — Inferred from your tsconfig.json or .swcrc configuration
  • Crash Loop Detection — Prevents infinite restart loops when your app crashes repeatedly
  • Graceful Shutdown — Proper cleanup of child processes on SIGINT/SIGTERM

Installation

pnpm add -D typerd

Global Options

| Option | Description | Default | |-----------------|-----------------------|---------| | -V, --verbose | Enable verbose output | false |

Commands

build

Build a TypeScript project.

typerd build [options]

Options:

| Option | Description | Default | |-----------------------------|---------------------------------------------|---------------| | -s, --source <dir> | Source directory | src | | -o, --output <dir> | Output directory | dist | | -c, --compiler <compiler> | Compiler to use (tsc or swc) | tsc | | --tsconfig <path> | Path to tsconfig file | auto-detected | | --clean | Clean output directory before build | true | | --no-clean | Skip cleaning output directory | | | --type-check | Run type checking (SWC only) | false | | --emit-types | Generate .d.ts declaration files (SWC only) | false | | -w, --watch | Watch mode for development | false |

start

Build and run a TypeScript project.

typerd start [entry] [options]

Arguments:

| Argument | Description | Default | |----------|-----------------------------------------|-----------| | entry | Entry file relative to source directory | main.ts |

Options:

All build options (except --emit-types) plus:

| Option | Description | Default | |----------------------------|-------------------------------------------------------------|---------| | -m, --module-type <type> | Module type for path alias resolution (esm or commonjs) | esm | | -d, --debug [hostport] | Run in debug mode (--inspect) | false | | --debug-brk [hostport] | Debug mode, pause on first line (--inspect-brk) | false |

Examples

# Build with TSC (default)
typerd build

# Build with SWC (fast, no type checking)
typerd build --compiler swc

# Build with SWC + type checking (best of both worlds)
typerd build --compiler swc --type-check

# Build with SWC + emit declaration files
typerd build --compiler swc --emit-types

# Watch mode
typerd build --watch

# Build and run once
typerd start

# Run a specific entry file
typerd start app.ts

# Watch mode with auto-restart
typerd start --watch

# Debug mode
typerd start --debug
typerd start --debug=9229
typerd start --debug-brk=localhost:9229

# CommonJS module resolution (for path aliases in watch mode)
typerd start --watch --module-type commonjs

Configuration

TypeScript (tsconfig.json)

typerd automatically detects your tsconfig.json (or tsconfig.build.json fallback). Key settings:

{
  "compilerOptions": {
    "outDir": "dist",
    "declaration": true,
    "declarationMap": true,
    "sourceMap": true,
    "paths": {
      "@/*": ["./src/*"]
    }
  }
}
  • declaration/declarationMap — Used by TSC; for SWC use --emit-types flag
  • sourceMap — Enables source maps for TSC builds and Node.js runtime
  • paths — Automatically resolved in compiled output (non-watch mode) or at runtime (watch mode)

SWC (.swcrc)

When using SWC compiler, create a .swcrc in your project root:

{
  "$schema": "https://swc.rs/schema.json",
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "decorators": true
    },
    "target": "es2022"
  },
  "sourceMaps": true
}
  • sourceMaps — Enables source maps for SWC builds and Node.js runtime

Compiler Comparison

| Feature | TSC | SWC | |-------------------|--------------|-------------------------| | Compilation Speed | Slower | ~20x faster | | Type Checking | Built-in | Via --type-check flag | | Declaration Files | Via tsconfig | Via --emit-types flag | | Source Maps | Via tsconfig | Via .swcrc | | Decorators | Full support | Full support |

Recommendation: Use SWC with --type-check for development (fast rebuilds with type safety), and TSC for production builds (most reliable).

Requirements

  • Node.js >= 18.0.0
  • TypeScript >= 5.x (peer dependency)

Optional Dependencies

When using SWC compiler:

pnpm add -D @swc/cli @swc/core

Troubleshooting

"Cannot find module" errors with path aliases

In watch mode, path aliases are resolved at runtime. Ensure your tsconfig.json has the correct baseUrl and paths configuration.

Crash loop detected

If your app crashes 3+ times within 5 seconds, typerd pauses restarts to prevent infinite loops. Fix the crash and save a file to trigger a restart.

SWC not found

Install SWC as a dev dependency:

pnpm add -D @swc/cli @swc/core

Type errors not showing with SWC

SWC doesn't type-check by default. Add --type-check to run TypeScript's type checker in parallel:

typerd build --compiler swc --type-check

License

MIT