Comparing version 3.1.0 to 3.2.0
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119732
5
482
87
4
16
+ Added@esbuild-kit/core-utils@1.4.0(transitive)
+ Added@esbuild/linux-loong64@0.14.54(transitive)
+ Addedesbuild@0.14.54(transitive)
+ Addedesbuild-android-64@0.14.54(transitive)
+ Addedesbuild-android-arm64@0.14.54(transitive)
+ Addedesbuild-darwin-64@0.14.54(transitive)
+ Addedesbuild-darwin-arm64@0.14.54(transitive)
+ Addedesbuild-freebsd-64@0.14.54(transitive)
+ Addedesbuild-freebsd-arm64@0.14.54(transitive)
+ Addedesbuild-linux-32@0.14.54(transitive)
+ Addedesbuild-linux-64@0.14.54(transitive)
+ Addedesbuild-linux-arm@0.14.54(transitive)
+ Addedesbuild-linux-arm64@0.14.54(transitive)
+ Addedesbuild-linux-mips64le@0.14.54(transitive)
+ Addedesbuild-linux-ppc64le@0.14.54(transitive)
+ Addedesbuild-linux-riscv64@0.14.54(transitive)
+ Addedesbuild-linux-s390x@0.14.54(transitive)
+ Addedesbuild-netbsd-64@0.14.54(transitive)
+ Addedesbuild-openbsd-64@0.14.54(transitive)
+ Addedesbuild-sunos-64@0.14.54(transitive)
+ Addedesbuild-windows-32@0.14.54(transitive)
+ Addedesbuild-windows-64@0.14.54(transitive)
+ Addedesbuild-windows-arm64@0.14.54(transitive)