Typescript Hello World

You should have Node.js installed on your machine to follow the steps.

Quick Start

initiate npm project

1
2
$ cd typescript-hello
$ npm init -y

install typescript and ts-node

1
$ npm install --save-dev typescript ts-node

or use the short version

1
$ npm i -D typescript ts-node

create hello.ts file

1
2
3
let hello: string = "hello world!";
console.log(hello);
console.log(`printing [${hello}]`);

run this command

1
$ ts-node hello.ts

if everything goes right, you can see the following output on your terminal

1
2
hello world!
printing [hello world!]