@zuke/tsx

← API reference

`@zuke/tsx` — typed `tsx` task wrappers for Zuke builds.

Symbols

# TsxCommonSettings class
class TsxCommonSettings extends ToolSettings

Options shared by every tsx invocation: the entry point and how to load it.

MemberSignatureDoc
script script(path: PathLike): this The entry point to execute (required).
scriptArgs scriptArgs(...args: Array<string | number>): this Arguments passed to the script (after the entry point).
tsconfig tsconfig(path: PathLike): this Use an explicit tsconfig.json (--tsconfig).
envFile envFile(path: PathLike): this Load environment variables from a file (--env-file).
noCache noCache(): this Disable the file-system transpile cache (--no-cache).
noWarnings noWarnings(): this Suppress Node warnings (--no-warnings).
conditions conditions(...names: string[]): this Custom export conditions to resolve (--conditions); repeatable.
importModule importModule(...modules: string[]): this Preload a module before the entry point (--import); repeatable.
# TsxSettings class
class TsxSettings extends TsxCommonSettings

Settings for tsx <file>.

# TsxTasks const
const TsxTasks: TsxTasksApi

Typed task functions for the tsx TypeScript runner.

# TsxTasksApi interface
interface TsxTasksApi

The shape of TsxTasks.

MemberSignatureDoc
tsx tsx(configure?: Configure<TsxSettings>): Promise<CommandOutput> Run a TypeScript entry point: tsx <file>.
watch watch(configure?: Configure<TsxWatchSettings>): Promise<CommandOutput> Re-run an entry point on changes: tsx watch <file>.
# TsxWatchSettings class
class TsxWatchSettings extends TsxCommonSettings

Settings for tsx watch <file>.

MemberSignatureDoc
noClearScreen noClearScreen(): this Keep prior output between reruns (--clear-screen=false).
include include(...paths: PathLike[]): this Additional paths to watch (--include); repeatable.
exclude exclude(...paths: PathLike[]): this Paths to ignore while watching (--exclude); repeatable.