typescript入門

$ npm –version
$ npm init
$ sudo npm install typescript
$ echo export PATH=\$PATH:`pwd`/node_modules/.bin >> ~/.bashrc
$ source ~/.bashrc
$ tsc –version
Version 4.2.4

function hello(name: string): void {
	console.log("Hello " + name + "!");
}
let your_name: string = "Yamada";
hello(your_name);

$ tsc sample.ts
$ node sample.js
Hello Yamada!