Typescript is a modern statically typed programming language that transpiles Javascript.
Javascript runtimes like node.js or deno are "required" to do typescript-based development. This is true whether you do Web frontend development or otherwise.
Node.js
You can install node.js from the node.js official website:
$ node --version
v16.14.0
Most node.js installations come with npm
, the node package manager.
In some cases, you may have to install it separately from the node.js runtime.
$ npm --version
8.8.0
Deno
$ deno --version
deno 1.20.3 (release, x86_64-unknown-linux-gnu)
v8 10.0.139.6
typescript 4.6.2
As you can see from the above output, typescript compiler is included in the deno distribution (for compiling the typescript program to javascript before running it in the V8 engine).
Typescript
Typescript compiler can be installed per project (if you use node.js). If you plan to do a lot of typescript-based development, however, it may be convenient to install it globally.
$ sudo npm i -g typescript
Depending on your platform,
you may need to use sudo
(or, something equivalent). Or not.
On multi-user platforms like Linux,
the global npm
modules are stored in the system central location,
and hence sudo
is needed.
$ tsc --version
Version 4.6.2
If you use Deno exclusively, a separate Typescript compiler installation may not be needed.
s
What's Next
Now that we have a development environment set up, let's try creating a simple program.
- Next Step: Creating the first program in Typescript
C C++ C# Clojure Crystal D Dart Erlang F# Go Haskell Java Javascript Julia Kotlin Lua Python Rust Scala Swift