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
Author ย  [email protected]
๐ŸŒ
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
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 61817 other projects in the npm registry ...
      ยป 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
๐ŸŒ
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.
Find elsewhere
๐ŸŒ
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
    
๐ŸŒ
Graphite
graphite.com โ€บ guides โ€บ npm-typescript
Using npm with TypeScript
To start using TypeScript in your projects, you first need to install it globally or locally using npm. This allows you to compile TypeScript files into JavaScript. ... This command installs TypeScript globally on your machine, allowing you ...
๐ŸŒ
npm
npmjs.com โ€บ search
tsc - npm search
An esbuild plugin which uses tsc to compile typescript files.
๐ŸŒ
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?

๐ŸŒ
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.
๐ŸŒ
Better Stack
betterstack.com โ€บ community โ€บ guides โ€บ scaling-nodejs โ€บ cli-tsc-compiler
Using the TypeScript Compiler (tsc): A Complete Guide | Better Stack Community
Learning tsc gives you a solid foundation that applies regardless of which build tools you eventually use in production projects. The TypeScript compiler comes as an npm package that you install as a development dependency in your project.
๐ŸŒ
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.
๐ŸŒ
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.
๐ŸŒ
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.