node.jsをインストールする
Javascript実行環境「node.js」のpkgをダウンロードしてインストールします。
関連リンク
typescriptをインストールする
npm install -g typescript
typescriptをjavascriptに変換する
作業ディレクトリを作成します。
mkdir test
cd test
tsファイルを作成します。
touch test.ts
tsファイルにtypescriptのプログラムを記述します。
console.log("hello world");
tscコマンドでjavascriptに変換します。
tsc test.ts
変換したjavascriptを実行します。
node test.js
コメント