Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tsx

Package Overview
Dependencies
Maintainers
1
Versions
109
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.4.0 to 3.4.1

dist/package-fb1d7b77.js

2

dist/loader.js

@@ -1,1 +0,1 @@

import{r}from"./pkgroll_create-require-1839faef.js";export*from"@esbuild-kit/esm-loader";import"module";r("@esbuild-kit/cjs-loader");
import{r}from"./pkgroll_create-require-97f6f9e8.js";export*from"@esbuild-kit/esm-loader";import"module";r("@esbuild-kit/cjs-loader");

@@ -1,3 +0,3 @@

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}).
import c from"repl";import{transform as l}from"@esbuild-kit/core-utils";import{v as m}from"./package-fb1d7b77.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.4.0",
"description": "Node.js runtime enhanced with esbuild for loading TypeScript & ESM",
"version": "3.4.1",
"description": "TypeScript Execute (tsx): Node.js enhanced with esbuild to run TypeScript & ESM files",
"keywords": [

@@ -38,5 +38,5 @@ "esbuild",

"dependencies": {
"@esbuild-kit/cjs-loader": "^2.0.0",
"@esbuild-kit/core-utils": "^1.1.1",
"@esbuild-kit/esm-loader": "^2.1.0"
"@esbuild-kit/cjs-loader": "^2.0.1",
"@esbuild-kit/core-utils": "^1.2.0",
"@esbuild-kit/esm-loader": "^2.1.2"
},

@@ -43,0 +43,0 @@ "optionalDependencies": {

# tsx
Node.js enhanced with [esbuild](https://esbuild.github.io/) to run TypeScript & ESM
_TypeScript Execute (tsx)_: Node.js enhanced with [esbuild](https://esbuild.github.io/) to run TypeScript & ESM files

@@ -15,2 +15,5 @@ ### Features

## Install
### Local installation
If you're using it in an npm project, install it as a development dependency:
```sh

@@ -20,12 +23,33 @@ npm install --save-dev tsx

### Install globally
Install it globally to use it anywhere, outside of your npm project, without [npx](https://docs.npmjs.com/cli/v8/commands/npx).
You can reference it directly in the `package.json#scripts` object:
```json5
{
"scripts": {
"dev": "tsx ..."
}
}
```
To use the binary, you can call it with [`npx`](https://docs.npmjs.com/cli/v8/commands/npx) while in the project directory:
```sh
npx tsx ...
```
### Global installation
If you want to use it in any arbitrary project without [npx](https://docs.npmjs.com/cli/v8/commands/npx), install it globally:
```sh
npm install --global tsx
```
You can call `tsx` directly:
```sh
tsx ...
```
## Usage
> Note: Commands are prefixed with [`npx`](https://docs.npmjs.com/cli/v8/commands/npx) to execute the `tsx` binary, but it's not necessary if globally installed or when using it in the `script` object in `package.json`
### Run TypeScript / ESM / CJS module

@@ -36,3 +60,3 @@

```sh
npx tsx ./file.ts
tsx ./file.ts
```

@@ -49,10 +73,10 @@

```sh
npx tsx watch ./file.ts
tsx watch ./file.ts
```
### REPL
Start a TypeScript REPL by running `tsx` with no arguments.
Start a TypeScript REPL by running with no arguments.
```sh
npx tsx
tsx
```

@@ -66,3 +90,3 @@

```sh
npx tsx --no-cache ./file.ts
tsx --no-cache ./file.ts
```

@@ -72,3 +96,3 @@

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.
`tsx` is a standalone binary designed to be used in-place of `node`, but sometimes you'll want to use `node` directly. For example, when adding TypeScript & ESM support to npm-installed binaries.

@@ -87,3 +111,5 @@ To use tsx with Node.js, pass it into the [`--loader`](https://nodejs.org/api/esm.html#loaders) flag.

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.
> Tip: In rare circumstances, you might be limited 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 only be applied to `require()`.

@@ -90,0 +116,0 @@ ## Dependencies

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