Socket
Socket
Sign inDemoInstall

tsx

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsx - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

dist/package-cafa1db4.js

6

package.json
{
"name": "tsx",
"version": "3.1.0",
"version": "3.2.0",
"description": "Node.js runtime enhanced with esbuild for loading TypeScript & ESM",

@@ -24,2 +24,5 @@ "keywords": [

],
"exports": {
"./repl": "./dist/repl.js"
},
"bin": "./dist/cli.js",

@@ -35,2 +38,3 @@ "scripts": {

"@esbuild-kit/cjs-loader": "^2.0.0",
"@esbuild-kit/core-utils": "^1.1.0",
"@esbuild-kit/esm-loader": "^2.0.0"

@@ -37,0 +41,0 @@ },

# tsx
Node.js runtime that can instantaneously load TypeScript & ESM, powered by [esbuild](https://esbuild.github.io/).
Node.js enhanced with [esbuild](https://esbuild.github.io/) to run TypeScript & ESM

@@ -8,2 +8,3 @@ ### Features

- Supports TS extensions `.cjs` & `.mjs` (`.cts` & `.mts`)
- TypeScript REPL
- Supports Node.js v12.20+

@@ -30,2 +31,4 @@ - Handles `node:` import prefixes

Pass in a file to run:
```sh

@@ -47,2 +50,9 @@ npx tsx ./file.ts

### REPL
Start a TypeScript REPL by running `tsx` with no arguments.
```sh
npx tsx
```
### Cache

@@ -62,1 +72,19 @@ Modules transformations are cached in the system cache directory ([`TMPDIR`](https://en.wikipedia.org/wiki/TMPDIR)). Transforms are cached by content hash so duplicate dependencies are not re-transformed.

- [@esbuild-kit/cjs-loader](https://github.com/esbuild-kit/cjs-loader) - Node.js `requie()` hook to transform TypeScript & ESM to CommonJS.
## FAQ
### Does it do type-checking?
No, [esbuild does not support type checking](https://esbuild.github.io/faq/#:~:text=TypeScript%20type%20checking%20(just%20run%20tsc%20separately)).
It's recommended to run TypeScript separately as a command (`tsc --noEmit`) or via [IDE IntelliSense](https://code.visualstudio.com/docs/languages/typescript).
### How is `tsx` different from [`ts-node`](https://github.com/TypeStrong/ts-node)?
They are both tools to run TypeScript files and start a TypeScript REPL.
The main difference is that `tsx` is powered by [esbuild](https://esbuild.github.io/) for blazing fast compilation. But because it uses esbuild, it doesn't type check like ts-node.
If you migrated from `ts-node`, please share your performance gains [here](https://github.com/esbuild-kit/tsx/discussions/10)!

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc