
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
Node.js runtime that can instantaneously load TypeScript & ESM, powered by esbuild.
.cjs & .mjs (.cts & .mts)node: import prefixesnpm install --save-dev tsx
Install it globally to use it anywhere, outside of your npm project, without npx.
npm install --global tsx
Note: Commands are prefixed with
npxto execute thetsxbinary, but it's not necessary if globally installed or when using it in thescriptobject inpackage.json
npx tsx ./file.ts
Run file and automatically re-run on changes.
All imported files are watched except from the following directories:
node_modules, bower_components, vendor, dist, and .* (hidden directories).
Press Return to manually re-run.
npx tsx watch ./file.ts
Modules transformations are cached in the system cache directory (TMPDIR). Transforms are cached by content hash so duplicate dependencies are not re-transformed.
Set the --no-cache flag to disable the cache:
npx tsx --no-cache ./file.ts
@esbuild-kit/esm-loader - TypeScript to ESM transpiler using the Node.js loader API.
@esbuild-kit/cjs-loader - TypeScript & ESM to CJS transpiler using the Node.js loader API.
ts-node is a very popular package that offers similar functionality to tsx. It provides the ability to execute TypeScript files directly and use TypeScript in a REPL environment. ts-node is widely used in the TypeScript community for development and scripting. Compared to tsx, ts-node has been around longer and has a larger user base, but both aim to simplify the TypeScript development workflow by removing the compilation step.
esbuild-runner offers a way to run TypeScript (and JavaScript) files using the esbuild bundler/compiler. It's focused on providing extremely fast compilation and execution, leveraging esbuild's performance. While esbuild-runner and tsx share the goal of simplifying the execution of TypeScript files, esbuild-runner emphasizes speed and is part of the broader ecosystem around the esbuild project.
FAQs
TypeScript Execute (tsx): Node.js enhanced with esbuild to run TypeScript & ESM files
The npm package tsx receives a total of 13,922,309 weekly downloads. As such, tsx popularity was classified as popular.
We found that tsx demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.