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 - Learn how to use npm tsc for TypeScript projects. Set up your environment, compile code, enhance with ESLint and Prettier, and optimize for production. Dive into Node.js and npm setup, TypeScript editor plugins, and advanced usage with bundlers and transpilers.
🌐
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.
🌐
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 - Join me in the post as I enhance an NPM package to support both ESM and CJS (CommonJS) consumers through the power of TSC (TypeScript Compiler).
🌐
npm
npmjs.com › package › tsc-watch
tsc-watch - npm
tsc-watch starts the installed TypeScript compiler (tsc) with --watch parameter, with the ability to react to compilation status. tsc-watch was created to allow an easy dev process with TypeScript.
      » npm install tsc-watch
    
Published   Sep 28, 2025
Version   7.2.0
Author   Gil Amran
Find elsewhere
🌐
npm
npmjs.com › package › tsc-files
tsc-files - npm
A tiny tool to run tsc on specific files without ignoring tsconfig.json. Latest version: 1.1.4, last published: 2 years ago. Start using tsc-files in your project by running `npm i tsc-files`. There are 11 other projects in the npm registry using tsc-files.
      » npm install tsc-files
    
Published   Jul 04, 2023
Version   1.1.4
Author   Gustavo P. Cardoso
🌐
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.
🌐
npm
npmjs.com › search
tsc - npm search
An esbuild plugin which uses tsc to compile typescript files.
🌐
GitHub
github.com › nodejs › TSC
GitHub - nodejs/TSC: The Node.js Technical Steering Committee
The Node.js Technical Steering Committee (TSC) is the technical governing body of Node.js.
Starred by 662 users
Forked by 139 users
Languages   JavaScript 97.7% | Shell 2.3%
🌐
Node.js
nodejs.org › en › learn › getting-started › nodejs-with-typescript
Node.js — Node.js with TypeScript
You can use ts-node to run TypeScript code directly in Node.js without the need to compile it first. But it's not typechecking your code. So we recommend to type check your code first with tsc and then run it with ts-node before shipping it. To use ts-node, you need to install it first: npm i -D ts-node ·
🌐
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 ...
      » npm install node-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:
🌐
npm
npmjs.com › package › typescript
typescript - npm
TypeScript is a language for application scale JavaScript development. Latest version: 5.9.3, last published: 2 months ago. Start using typescript in your project by running `npm i typescript`. There are 61819 other projects in the npm registry ...
      » npm install typescript
    
Published   Sep 30, 2025
Version   5.9.3
Author   Microsoft Corp.
🌐
Graphite
graphite.com › guides › npm-typescript
Using npm with TypeScript
This allows you to compile TypeScript files into JavaScript. ... This command installs TypeScript globally on your machine, allowing you to access the TypeScript compiler (tsc) from anywhere ...
🌐
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?