Quickstart
Create and run a new TaserJS project in under a minute with create-taserjs. Choose your favorite server adapter, schema validator, ORM, and logger.
The quickest way to get started with Taser is using the official create-taserjs scaffolding tool. It generates a pre-configured, production-ready project with TypeScript, hot-reloading, route watching, and your choice of tools.
Prerequisites
Before creating a project, make sure your development environment meets these requirements:
- Node.js: Version
20.19.0or higher - Package Manager:
npm,pnpm,yarn, orbun - TypeScript: Version
5.0or higher
Create a New Project
Run the Scaffolding Command
Run the interactive initializer in your terminal:
pnpm create taserjs@latestChoose Your Stack
The interactive wizard will guide you through selecting your preferred tools:
- Project Name: Enter a directory name (for example,
my-taser-api). - Host Framework:
- None (Standalone): Pure Taser with high-performance virtual routing and zero host overhead (default).
- Hono: Lightweight web standard framework for Node, Bun, Deno, and edge runtimes.
- Express: Battle-tested Node.js web framework with pass-through routing.
- Fastify: High-throughput Node.js framework with pass-through routing.
- Deployment Target / Preset:
- Node Server (
node-server,node-cluster): Standard Node.js environments (default:node-server). - Standalone Vite (
none): Directvite buildwith production serve shim without Nitro. - Serverless & Edge:
cloudflare-module,vercel,aws-lambda,netlify. - Runtimes:
bun,deno-server,deno-deploy.
- Node Server (
- Runtime Override (Optional):
- Override runtime for self-hosted targets (
node,bun, or preset default).
- Override runtime for self-hosted targets (
- Database / ORM (Optional):
- Drizzle, Prisma, Kysely, or None (supports
sqlite,postgres, ormysqldrivers).
- Drizzle, Prisma, Kysely, or None (supports
- Logger (Optional):
- Pino, Winston, or standard Console.
- Schema Validator (Optional):
- Zod: TypeScript-first schema declaration and validation.
- ArkType: TypeScript-native syntax with runtime performance.
- Valibot: Modular, lightweight, tree-shakeable schema library.
Non-Interactive Scaffolding
You can pass CLI flags directly for automated or CI environments:
pnpm create taserjs@latest my-api \
--framework none \
--preset node-server \
--db drizzle:postgres \
--validator zod \
--logger pino \
-yCLI Flags Reference
| Flag | Description | Values / Syntax | Default |
|---|---|---|---|
--framework | Host server framework | none, hono, express, fastify | none |
--preset, -p | Deployment preset (Nitro target or none) | none, node-server, node-cluster, bun, deno-server, deno-deploy, cloudflare-module, vercel, aws-lambda, netlify | node-server |
--runtime | Explicit runtime override (for self-hosted presets) | node, bun, deno | Implied by preset |
--db | Database ODM and optional driver (odm:driver) | drizzle, prisma, kysely with :sqlite, :postgres, :mysql (e.g. drizzle:postgres) | None (driver defaults to sqlite) |
--validator | Schema validation library | zod, arktype, valibot | None |
--logger | Structured logger integration | pino, winston | None |
-y, --yes | Non-interactive mode using defaults for omitted flags | boolean | false |
--noInstall | Skip automatic package installation | boolean | false |
--json | Output result as JSON (prints capability catalog when no name) | boolean | false |
Start the Development Server
Navigate to your new project directory, install dependencies, and start the development server:
cd my-taser-api
pnpm install
pnpm devThe development server starts with Vite. Route changes inside src/routes/ are updated virtually with instant HMR and ambient TypeScript definitions written to .taser/types/.
Project Structure Overview
A freshly scaffolded Taser project contains a clean, modern layout:
/*//healthKey Files Explained
vite.config.ts: Connects thetaser()plugin from@taserjs/router-plugin/viteandnitro()for zero-config builds (or pure Vite in standalonenonepreset).nitro.config.ts(conditional): Generated when targeting non-default deployment presets (e.g.cloudflare-module,vercel,aws-lambda,netlify). Omitted for defaultnode-serverand standalonenone.src/server.ts/src/server.node.ts(conditional): Generated when a host framework is configured (src/server.tsfor Hono,src/server.node.tsfor Express or Fastify).src/taser.ts: Configures thecreateTaserApp()instance, error boundaries (.onError()), response validation, and context binding.src/context.ts: Defines application singletons (database, logger, external services) and request-scoped context.src/routes/: Contains your API endpoints (index.get.ts,health.get.ts) and root layout middleware ($.ts)..taser/: Contains auto-generated ambient TypeScript types (.taser/types/) so your editor provides full route autocomplete.
Add Your First Route
To create a new endpoint, add a file in the src/routes/ directory.
Create src/routes/hello.get.ts:
import { json } from "@taserjs/router/reply";
import { t } from "@taserjs/router";
export default t.get("/hello").handler(() => {
return json({
message: "Hello from Taser!",
timestamp: new Date().toISOString(),
});
});Save the file. Vite hot-reloads the new route immediately without restarting the dev server.
Test your new endpoint in another terminal or browser:
curl http://localhost:3000/helloResponse:
{
"message": "Hello from Taser!",
"timestamp": "2026-08-25T00:00:00.000Z"
}Automatic Boilerplate Generation
When you create a new empty route file (e.g. touch src/routes/users/$id.get.ts), Vite or npx taser generate automatically fills it with type-safe starter boilerplate.
Next Steps
Now that your project is running, explore these guides to build out your application:
Manual Installation
Learn how to install Taser step by step into an existing project.
Core Concepts
Understand the request lifecycle, context injection, and state propagation.
File-Based Routing
Learn parameter mapping, splats, pathless layouts, and grouping.
Validation Guide
Validate query, params, headers, and request bodies with Standard Schema.
Introduction
High-performance, file-based REST API router for TypeScript. Zero runtime drift, cascading middleware context, and automatic client generation.
Manual Installation
Step-by-step guide to installing and configuring Taser manually with Vite, Nitro deployment presets, Next.js, and host pass-through dispatching.