programming language, superset of JavaScript that compiles to JavaScript

TypeScript (TS) is a high-level programming language that adds static typing with optional type annotations to JavaScript. It is designed for developing large applications. It transpiles to JavaScript. It is developed by … Wikipedia
Factsheet
Family ECMAScript
Designed by Microsoft,
Anders Hejlsberg,
Luke Hoban
Factsheet
Family ECMAScript
Designed by Microsoft,
Anders Hejlsberg,
Luke Hoban
🌐
npm
npmjs.com › package › tsc
tsc - npm
A deprecated release of the TypeScript compiler. Latest version: 2.0.4, last published: 4 years ago. Start using tsc in your project by running `npm i tsc`. There are 774 other projects in the npm registry using tsc.
      » npm install tsc
    
Published   Jan 15, 2022
Version   2.0.4
🌐
TypeScript
typescriptlang.org › download
TypeScript: How to set up TypeScript
You can use npm to install TypeScript globally, this means that you can use the tsc command anywhere in your terminal.
🌐
daily.dev
daily.dev › home › blog › get into tech › npm tsc and typescript projects
Npm tsc and TypeScript Projects
February 4, 2025 - TypeScript transforms your code into JavaScript that browsers can understand. npm tsc is a tool that compiles TypeScript (.ts) files into JavaScript (.js) files.
🌐
npm
npmjs.com › package › typescript
typescript - npm
Latest version: 5.9.3, last published: 2 months ago. Start using typescript in your project by running `npm i typescript`. There are 61825 other projects in the npm registry using typescript.
      » npm install typescript
    
Published   Sep 30, 2025
Version   5.9.3
Author   Microsoft Corp.
🌐
Visual Studio Code
code.visualstudio.com › docs › typescript › typescript-compiling
Compiling TypeScript
November 3, 2021 - Visual Studio Code includes TypeScript language support but does not include the TypeScript compiler, tsc. You will need to install the TypeScript compiler either globally or in your workspace to transpile TypeScript source code to JavaScript (tsc HelloWorld.ts). The easiest way to install TypeScript is through npm, the Node.js Package Manager.
🌐
npm
npmjs.com › package › tsc-watch
tsc-watch - npm
The TypeScript compiler with onSuccess command. Latest version: 7.2.0, last published: 2 months ago. Start using tsc-watch in your project by running `npm i tsc-watch`. There are 240 other projects in the npm registry using tsc-watch.
      » npm install tsc-watch
    
Published   Sep 28, 2025
Version   7.2.0
Author   Gil Amran
Find elsewhere
🌐
DEV Community
dev.to › mbarzeev › hybrid-npm-package-through-typescript-compiler-tsc-150c
Hybrid NPM package through TypeScript Compiler (TSC) - DEV Community
February 11, 2022 - And there we have it! I’ve taken TSC and used it as a simple bundler which can produce both ESM and CJS artifacts from my package’s source code. I then allowed my package to be consumed by either ESM or CJS code with the help of the NPM’s “exports” feature.
🌐
Learn TypeScript
learntypescript.dev › 11 › l1-installing-running-compiler
Installing and running the compiler | Learn TypeScript
This command first downloads and installs the typescript npm package. tsc is the executable name of the TypeScript compiler.
🌐
npm
npmjs.com › package › node-typescript-compiler
node-typescript-compiler - npm
Exposes typescript compiler (tsc) as a node.js module. Latest version: 4.0.0, last published: 2 years ago. Start using node-typescript-compiler in your project by running `npm i node-typescript-compiler`. There are 24 other projects in the npm registry using node-typescript-compiler.
      » npm install node-typescript-compiler
    
🌐
Node.js
nodejs.org › en › learn › getting-started › nodejs-with-typescript
Node.js — Node.js with TypeScript
This tool allows us to run TypeScript's compiler without installing it globally. tsc is the TypeScript compiler which will take our TypeScript code and compile it to JavaScript. This command will result in a new file named example.js that we ...
🌐
Reddit
reddit.com › r/typescript › how to run tsc during npx
r/typescript on Reddit: How to run tsc during npx
January 26, 2024 -

I'm learning typescript and I'm trying to create a script that will execute js files created by tsc. This is my package.json:

{
  "bin": "bin/tutorial.js",
  "scripts": {
    "start": "node bin/tutorial.js",
    "prestart": "npm run build",
    "build": "tsc"
  }

bin/tutorial.js is just a custom js file that I wrote that will execute the compiled js files in lib (tsconfig has outDir set to lib):

#!/usr/bin/env node
require('../lib/tutorial');

I am able to run the script using npm start, since it will build beforehand. However if I clean the lib directory and do 'npx .' then the tsc build will never happen. This means that the lib directory will be empty and my bin/tutorial.js file won't be able to import the compiled js.

How do I ensure that my scripts executed with npx can run the build step beforehand?

🌐
npm
npmjs.com › search
tsc - npm search
An esbuild plugin which uses tsc to compile typescript files.
🌐
Node.js
nodejs.org › en › learn › typescript › transpile
Node.js — Running TypeScript code using transpilation
NOTE: npx is a tool that allows you to run Node.js packages without installing them globally. tsc is the TypeScript compiler which will take our TypeScript code and compile it to JavaScript.
🌐
Carl Rippon
carlrippon.com › installing-and-running-the-typescript-compiler
Installing and Running the TypeScript Compiler | Building SPAs
This command first downloads and installs the typescript npm package. tsc is the executable name of the TypeScript compiler.
🌐
Simon Willison
til.simonwillison.net › typescript › basic-tsc
Very basic tsc usage | Simon Willison’s TILs
Apparently I need a tsconfig.json file. Running this command creates one for me containing some suggested defaults: ... Next step: create a .ts file to start testing it out. I put the following in greetings.ts: const greeting = (person: string) => { console.log("Hello " + person); }; greeting("Simon"); Next, compile it! Thanks to npm install --save-dev typescript the tsc compiler is now available here:
🌐
Microsoft Learn
learn.microsoft.com › en-us › visualstudio › javascript › compile-typescript-code-npm
Compile and build TypeScript code using npm - Visual Studio (Windows) | Microsoft Learn
To install using the IDE, right-click the npm node in Solution Explorer, choose Install New npm package, search for TypeScript, and install the package. Check the npm option in the Output window to see package installation progress.