type script npm code example Example 1: install typescript using npm npm install -g typescript Example 2: create typescript project npx tsc index.ts