New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@remix-run/node-tsx

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remix-run/node-tsx

Run Node.js with TypeScript and JSX syntax support

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

node-tsx

Run Node.js with TypeScript and JSX syntax support in .ts, .tsx, and .jsx files.

node-tsx transforms supported source files before Node.js executes them, including TypeScript syntax that requires JavaScript code generation such as enums, runtime namespaces, and parameter properties. JSX compiler options are read from the nearest tsconfig.json for each loaded file.

The loader does not type check, change Node.js module resolution, apply TypeScript path aliases, or downlevel JavaScript syntax for older runtimes.

Installation

npm i remix

Usage

Pass the --import flag to register the remix/node-tsx loader when executing node:

node --import remix/node-tsx ./server.ts

TypeScript configuration

Since import resolution still follows Node.js, configure type checking to match native Node loading:

{
  "compilerOptions": {
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "allowImportingTsExtensions": true,
    "isolatedModules": true,
    "verbatimModuleSyntax": true,
    "rewriteRelativeImportExtensions": true
  }
}
  • module and moduleResolution use NodeNext so TypeScript resolves modules the way Node does.
  • allowImportingTsExtensions allows source files to import .ts and .tsx modules directly.
  • isolatedModules avoids patterns that require whole-program compilation, such as re-exporting a type without export type.
  • verbatimModuleSyntax requires type-only imports and exports to be marked so runtime imports are unambiguous.
  • rewriteRelativeImportExtensions preserves a tsc emit path by rewriting relative .ts and .tsx imports to JavaScript extensions.

Do not enable erasableSyntaxOnly if you want TypeScript to accept the same transform-only syntax that node-tsx can execute.

Programmatic usage

Registering the loader

Import remix/node-tsx as a side effect to register the loader.

import 'remix/node-tsx'

Loading a module with scoped JSX support

Load a module with TypeScript and JSX syntax support scoped to its import graph:

import { loadModule } from 'remix/node-tsx/load-module'

let mod = await loadModule('./app/server.tsx', import.meta.url)

License

See LICENSE

Keywords

remix

FAQs

Package last updated on 01 Oct 2026

Related posts