*Writing your first TypeScript code might feel intimidating. Don't worry, i got you! 🤝 *
1 - Create a folder
I name it tstest.
You can use the command mkdir like this or create it manually.
2 - Open it and initialise your project
Run the command npm init -y
to initialise your project and create the package.json file.
3 - Install parcel
Run the command npm i -g parcel-bundler
to install parcel globally
4 - Create a new file
-in your terminal type touch index.html
5 -Open Visual Studio Code
-in your terminal type the command code .
to open the folder in vs code
6- Create a html document
-Use the emmet snippet like in the image below
7- Add a script tag with a source index.ts
8- Create the file index.ts
- Create the file index.ts and write this in it
9- Then typescript can handle anything for us
10 - Type in the terminal parcel index.html
11- It will install typescript and start a server at port 1234
As you can see everything is working!!!
Top comments (0)