Languages
TypeScript
Installing TypeScript on Ubuntu in TIDE
TypeScript
TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale. It compiles to plain JavaScript.
Installation
TypeScript requires Node.js and NPM. To install TypeScript and ts-node globally on TIDE's Ubuntu environment:
apt update
apt install -y nodejs npm
npm install -g typescript ts-nodeVerification
Verify the TypeScript compiler (tsc) installation:
tsc --versionHello World Example
Create a TypeScript file named hello.ts:
echo 'const message: string = "Hello, TypeScript!"; console.log(message);' > hello.tsRunning with ts-node
You can execute TypeScript files directly using ts-node:
ts-node hello.tsCompiling and Running with Node.js
Alternatively, compile the TypeScript file into JavaScript and run it with Node.js:
tsc hello.ts
node hello.js