# xtsc

> A Typescript loader

Latest version **1.3.3** (published 2023-09-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install xtsc
pnpm add xtsc
yarn add xtsc
bun add xtsc
```

Provides the commands `xtsc`, `xwtsc`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.3 |
| Published | 2023-09-19 |
| First published | 2023-05-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 183.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Daniel Jge |
| Maintainers | danieljge |
| Keywords | typescript, swc, esbuild, cli, esm, commonjs |

## Links

- npm: https://www.npmjs.com/package/xtsc
- Repository: https://github.com/HeVyBlack/xtsc
- Homepage: https://github.com/HeVyBlack/xtsc#readme
- Issues: https://github.com/HeVyBlack/xtsc/issues
- npm.io page: https://npm.io/package/xtsc

## Dependencies (6)

- [chalk](https://npm.io/package/chalk.md) 5.3.0
- [esbuild](https://npm.io/package/esbuild.md) 0.19.3
- [chokidar](https://npm.io/package/chokidar.md) 3.5.3
- [@swc/core](https://npm.io/package/@swc/core.md) 1.3.86
- [tsc-alias](https://npm.io/package/tsc-alias.md) 1.8.7
- [module-alias](https://npm.io/package/module-alias.md) 2.2.3

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.3.3 (latest) — 2023-09-19
- 1.3.2 — 2023-09-01
- 1.3.1 — 2023-08-31
- 1.3.0 — 2023-08-30
- 1.2.6 — 2023-08-30
- 1.2.5 — 2023-08-30
- 1.2.4 — 2023-08-29
- 1.2.3 — 2023-08-29
- 1.2.2 — 2023-08-02
- 1.2.1 — 2023-07-24
- 1.2.0 — 2023-07-13
- 1.1.9 — 2023-06-26
- 1.1.8 — 2023-06-24
- 1.1.7 — 2023-06-22
- 1.1.6 — 2023-06-22
- … 11 more at https://npm.io/package/xtsc/versions

## README

#  XTSC

A **Typescript** loader, bundler and compiler, that use **SWC** and **ESBUILD**.

  

- To install: `npm i -g xtsc` or `npm i -D xtsc`

 - To use: `xtsc [action] [file|flags]` or `npx xtsc [action] [files|flags]` or `xtsc [file][flags] to run a single file`
 

***New:**
New command available: `xwtsc`.
What this new command does:
| Action | What it does |
|--|--|
| *blank space* | REPL |
| build | build the project |
| bundle `entry point` `output point` | bundle the project |
| watch `file` | Watch and run on changes |
| run `file` ***or only*** `file`| Run program |
| check | Type check the whole project |
| init | Create a **tsconfig.json** |



|flag| Available on |
|--|--|
| --watch | build, bundle, check |
| --args: `[args for program]` | watch, run (must be the last flag)|
| --minify | bundle |
| --tsconfig `your tsconfig.json` | every command |


The point of this new command, is to use the most Typescript's API services, so, will build using the **Typescript's Compiler**, will make **typecheck** before initialize the program, and, will use the **transpileModule method**.


***New:**


Now, you can use path alias in your project. Can be used in `run`, `watch`, `bundle`, `build`


**Actions:**

  

| Action | What it does |
|--------------|--|
| *blank space* | REPL |
| build `root dir`  `build dir`  *or*  `file`  `out file`| Build the project/file |
| bundle `file`  `bundle file` | Bundle a file |
| watch `file` | Watch for changes **in .ts .mts and .cts files** |
| run `file`  ***or only***  `file` | Run a **.ts** file|
| check | Type check the whole project |
| init | Create a **tsconfig.json** file |

  

**Each action has certain flags:**

  

*Build:*


-  `--minify` Will minify each *Javascript* file.

-  `--sourceMaps` Will save the the source map of each file.

-  `--watch` Watch for changes.

-  `--noClear` Avoid clearing the console when you are using the --watch flag.


*Bundle:*


-  `--minify` Will minify the *.js* file.

-  `--sourceMaps` Will save the source map of the file.

-  `--watch` Watch for changes.

-  `--noClear` Avoid clearing the console when you are using the --watch flag.

*Run / Watch:*

-  `--noClear` Avoid clearing the console when the program initializes.

-  `--args= [...args]` Args for your program, this flag, must be the last flag.


*Check:*


-  `--watch` Watch for changes.

-  `--tsconfig [tsconfig]`Will search and use the provided tsconfig.

  

**Notes:**

My idea, is, in the case you are using **"type": "module"** in your **package.json**, you import all your **Typescript** files with **Ts extensions,** so, you can use **allowImportingTsExtensions** in your **tsconfig.json.**

  

With this idea, when you build your project, **xtsc will change all the Ts extensions to Js extensions**.

  

In the case you are using **"type": "commonjs"**, you can also import your **Typescript** files with **Ts extensions** extension, but, is not necessary.

  

**Important:**

**In the case you are using "type": "module" , xtsc will obligate you to import all your Typescript files with Ts extensions.**

  
  

**In other case, if you are using "type": "commonjs", you may not have to worry about this, but, in the case you import your Typescript files with Js extensions, xtsc will obligate you to import your files with Ts extensions.**

  

**Remember, xtsc will change the .ts | .mts | .cts extensions to .js | .mjs | .cjs extensions on build.**

  

And, **xtsc** will respect **.mts** and **.cts** extensions!

---
_Source: https://npm.io/package/xtsc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
