一键导入
tsx-skilld
ALWAYS use when writing code importing "tsx". Consult for debugging, best practices, or modifying tsx.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
ALWAYS use when writing code importing "tsx". Consult for debugging, best practices, or modifying tsx.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
ALWAYS use when writing code importing "ctx7". Consult for debugging, best practices, or modifying ctx7, context7.
ALWAYS use when writing code importing "daisyui". Consult for debugging, best practices, or modifying daisyui.
ALWAYS use when writing code importing "@storybloq/storybloq". Consult for debugging, best practices, or modifying @storybloq/storybloq, storybloq/storybloq, storybloq storybloq, storybloq.
Use this skill to generate well-branded interfaces and assets for syn.horse — a fictional cyberpunk/glitch-vaporwave shitpost-friendly product. Contains essential design guidelines, colors, type, fonts, assets, and UI kit components for prototyping.
ALWAYS use when writing code importing "@anthropic-ai/claude-code". Consult for debugging, best practices, or modifying @anthropic-ai/claude-code, anthropic-ai/claude-code, anthropic-ai claude-code, anthropic ai claude code, claude-code-2.1.88, claude code 2.1.88.
ALWAYS use when writing code importing "@nuxtjs/seo". Consult for debugging, best practices, or modifying @nuxtjs/seo, nuxtjs/seo, nuxtjs seo, nuxt-seo, nuxt seo.
| name | tsx-skilld |
| description | ALWAYS use when writing code importing "tsx". Consult for debugging, best practices, or modifying tsx. |
| metadata | {"version":"4.23.0","generated_by":"Anthropic · Haiku 4.5","generated_at":"2026-07-03T00:00:00.000Z"} |
tsx@4.23.0Tags: latest: 4.23.0
References: package.json • README • Docs • Issues • Releases
Use skilld search "query" -p tsx instead of grepping .skilld/ directories. Run skilld search --guide -p tsx for full syntax, filters, and operators.
This section documents version-specific API changes in tsx v4.x — focusing on recent minor releases and runtime API updates that have changed since earlier v4 versions.
DEPRECATED: node --loader tsx — deprecated in favor of node --import tsx since Node.js v20.6.0. The --loader flag is legacy and no longer recommended for new code source
NEW: node --import tsx — stable API for enhancing Node.js with tsx support. Replaces the deprecated --loader flag and is the recommended way to use tsx with the node command directly source
NEW: node --require tsx/cjs — CommonJS-only enhancement, available as an alternative to full-runtime registration source
NEW: node --import tsx/esm — ES Module-only enhancement for registering tsx on ESM modules only source
DEPRECATED: tsx watch --ignore flag — removed in v4.19.0 in favour of --exclude flag. Old --ignore patterns no longer work source
NEW: tsx watch --exclude flag — replaces the deprecated --ignore flag. Use glob patterns to exclude specific files or directories from being watched source
NEW: tsx watch --include flag — explicitly include specific files or directories to watch beyond the default watched dependencies source
tsx/esm/api)NEW: register({ namespace }) — scoped registration for ESM. When a namespace is provided, returns a private import() method and does not affect global state source
NEW: api.import(file, parentURL) — namespace-scoped import function. Each namespace maintains independent module cache source
NEW: onImport hook — callback hook for tracking loaded files during registration. Receives file URL as argument source
tsx/cjs/api)NEW: register({ namespace }) — scoped registration for CommonJS. Returns private require() method without affecting global state source
NEW: api.require(file, __filename) — namespace-scoped require function for isolated CommonJS module loading source
NEW: tsImport(file, { parentURL, tsconfig }) — tsconfig option added to support custom tsconfig.json paths or disabling lookup entirely. Accepts string path or false to disable source
NEW: tsImport(file, { parentURL, onImport }) — onImport hook for tracking file loads during dynamic imports source
NEW: tsx.require.cache — CommonJS require.cache integration for dependency tracking. Useful for implementing watchers source
NEW: TSX_TSCONFIG_PATH environment variable — set custom tsconfig.json path when using node --import tsx. Works with both --import and legacy --loader source
NEW: Node.js version support expanded — v4.21.1 added explicit support for Node.js 24.15.0, 26.1.0, 25.9.0, 20.11, and 21.2 source
Also changed: ESM JSON attribute handling (v4.20.1) · sourcesContent in debugging (v4.19.2) · esbuild upgrades (v4.22.0, v4.21.0) · async module.register() hook state isolation (v4.22.5)
Separate type checking from execution — run tsx for quick development iteration and use tsc --noEmit in pre-commit hooks or CI pipelines to catch type errors independently source
Configure tsconfig.json with moduleDetection: "force", module: "Preserve", allowJs: true, esModuleInterop: true, and isolatedModules: true for consistent, predictable type-checking behaviour across tools source
Never publish uncompiled TypeScript to npm — always compile source files using pkgroll (the recommended bundler maintained by tsx's author) to ensure correct configuration and avoid runtime performance degradation source
Use tsx as a direct drop-in replacement for node with identical CLI flag support, enabling seamless switching between the two commands without syntax changes source
Position tsx command flags immediately after the command, and script flags/arguments after the script path — correct ordering is essential for proper argument parsing source
Use tsx watch for development workflows to automatically re-run your script whenever any watched dependency changes, accelerating iteration speed without manual restarts source
Prefer node --import tsx over runtime import 'tsx' in source code for better transparency and because it's visible in the command-line invocation source
Use scoped registration with register({ namespace: ... }) when third-party packages need to load TypeScript files without affecting the entire runtime environment source
Use tsImport() API for one-time, non-cached TypeScript file imports without adding global TypeScript support to the runtime source
Use tsx --test to automatically run Node.js built-in test runner with TypeScript support — it recognises test files with patterns like *.test.ts, *-test.ts, and files in test/ directories source
Track module dependencies using tsx.require.cache when implementing custom watchers or dependency analysis in CommonJS environments source
Use #!/usr/bin/env -S npx tsx as the shebang for executable TypeScript scripts in projects with locally installed tsx, enabling direct file execution source
Understand module-type limitations: CommonJS registration doesn't enhance import() calls, and ESM registration doesn't affect static imports — choose the registration API that matches your module type source
Use environment variable TSX_TSCONFIG_PATH when running tsx through Node.js CLI to specify a custom tsconfig.json path, especially when integrating with tools that call node directly source