Comparing version 3.3.1 to 3.4.0
@@ -1,3 +0,3 @@ | ||
import c from"repl";import{transform as l}from"@esbuild-kit/core-utils";import{v as m}from"./package-1162f6d5.js";console.log(`Welcome to tsx v${m} (Node.js ${process.version}). | ||
import c from"repl";import{transform as l}from"@esbuild-kit/core-utils";import{v as m}from"./package-2effcb46.js";console.log(`Welcome to tsx v${m} (Node.js ${process.version}). | ||
Type ".help" for more information.`);const o=c.start(),{eval:i}=o,f=async function(e,r,t,s){const n=await l(e,".ts").catch(a=>(console.log(a.message),{code:` | ||
`}));return i.call(this,n.code,r,t,s)};o.eval=f; |
{ | ||
"name": "tsx", | ||
"version": "3.3.1", | ||
"version": "3.4.0", | ||
"description": "Node.js runtime enhanced with esbuild for loading TypeScript & ESM", | ||
@@ -25,2 +25,3 @@ "keywords": [ | ||
"exports": { | ||
".": "./dist/loader.js", | ||
"./cli": "./dist/cli.js", | ||
@@ -27,0 +28,0 @@ "./repl": "./dist/repl.js" |
@@ -65,2 +65,20 @@ # tsx | ||
### Node.js Loader | ||
tsx is a standalone binary used in-place of Node.js, but sometimes you'll want to use `node` directly. For example, when adding TypeScript & ESM support to Node.js binaries. | ||
To use tsx with Node.js, pass it into the [`--loader`](https://nodejs.org/api/esm.html#loaders) flag. | ||
> Note: Node.js's experimental feature warnings will not be suppressed when used as a loader | ||
```sh | ||
# As a CLI flag | ||
node --loader tsx ./file.ts | ||
# As an environment variable | ||
NODE_OPTIONS='--loader tsx' node ./file.ts | ||
``` | ||
If you're looking to use the [`-r, --require`](https://nodejs.org/api/cli.html#-r---require-module) flag, you can use [`@esbuild-kit/cjs-loader`](https://github.com/esbuild-kit/cjs-loader) but transformations _will not_ be applied to dynamic `import()`s. | ||
## Dependencies | ||
@@ -67,0 +85,0 @@ |
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
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
120919
7
483
108
18