how to init typescript project code example Example 1: typescript init npm i -D typescript tsc --init Example 2: create typescript project npx tsc index.ts