https://github.com/uanela/tsx-strict
The TSX with automatic Type-Checking
https://github.com/uanela/tsx-strict
deno nodejs runner ts-node-dev tsx type-checking type-safe typescript
Last synced: about 2 months ago
JSON representation
The TSX with automatic Type-Checking
- Host: GitHub
- URL: https://github.com/uanela/tsx-strict
- Owner: Uanela
- License: mit
- Created: 2025-08-25T03:09:30.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2026-04-04T20:37:46.000Z (about 2 months ago)
- Last Synced: 2026-04-04T22:41:32.046Z (about 2 months ago)
- Topics: deno, nodejs, runner, ts-node-dev, tsx, type-checking, type-safe, typescript
- Language: TypeScript
- Homepage:
- Size: 224 KB
- Stars: 7
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# The TSX with automatic Type-Checking
Run TypeScript files with TSX while providing real-time type checking.
## Features
- Real-time type checking alongside tsx execution
- Watch mode with automatic restarts
- Intelligent process management
- Customizable compiler support
- Memory management options
- Config file support (`tsx-strict.config.ts` / `tsxs.config.ts`)
## Installation
```bash
pnpm install -g tsx-strict
```
Or use with npx:
```bash
npx tsxs src/index.ts
```
## Usage
```bash
tsxs app.ts
```
### Watch Mode
```bash
tsxs --watch app.ts
```
### Skip Type Checking
```bash
tsxs --no-type-check app.ts
```
## CLI Options
| Option | Description | Default |
| ---------------------- | ---------------------------------------- | -------------------- |
| `-w, --watch` | Enable watch mode | `false` |
| `--no-clear` | Do not clear screen | `false` |
| `--compiler` | Compiler path | `typescript/bin/tsc` |
| `--tsc-args ` | Additional TypeScript compiler arguments | `[]` |
| `--tsx-args ` | Additional tsx arguments | `[]` |
| `--silent` | Suppress output | `false` |
| `--no-type-check` | Skip type checking (run tsx directly) | `false` |
## Config File
Create a `tsx-strict.config.ts` or `tsxs.config.ts` at your project root for persistent configuration. CLI args always take precedence over the config file.
```typescript
import { defineConfig } from "tsx-strict/config";
export default defineConfig({
watch: true,
clear: true,
typeCheck: true,
compiler: "typescript/bin/tsc",
tscArgs: ["--strict"],
tsxArgs: ["--env-file=.env"],
maxNodeMem: "4096",
});
```
### Watch Options
`watch` can be `true` to use defaults, or an object for full control:
```typescript
import { defineConfig } from "tsx-strict/config";
export default defineConfig({
watch: {
include: ["src/**"],
ignore: ["**/*.test.ts", /generated/, (path) => path.includes("dist")],
extensions: ["ts", "tsx", "js"],
},
});
```
## How It Works
Runs `tsc --noEmit` for type checking and `tsx` for execution. Restarts tsx only when type checking passes and kills previous instances to prevent conflicts.
Built with ♥️ by Uanela Como