Skip to content

annuk123/TypeScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README.md template for learning TypeScript concepts, which focuses on installation, file structure, and setup. This template is designed for someone who is learning TypeScript and wants to use it as a study guide.


TypeScript Learning Guide

This guide helps you get started with TypeScript from scratch. It's focused on learning concepts rather than building a specific project. You will learn how to install TypeScript, understand the basic file structure, and set up a TypeScript environment for practice.


What is TypeScript?

TypeScript is a superset of JavaScript that adds static typing to help catch potential errors during development. It is compiled down to plain JavaScript, making it compatible with all JavaScript environments.

Why Learn TypeScript?

  • Static Typing: It helps catch type-related errors before runtime.
  • Better Tooling: Enhanced code editing and auto-completion in IDEs.
  • Scalability: Great for large applications with complex codebases.

Installation

To begin learning TypeScript, you need to install the TypeScript compiler (tsc), which translates TypeScript code into JavaScript.

Install TypeScript Globally

Using npm (Node Package Manager), you can install TypeScript globally on your system:

npm install -g typescript

Verify the installation:

tsc --version

If installed correctly, this will print the installed TypeScript version.


Forking the Repository

To contribute, you will need to fork the repository and clone it locally. Here's how to do it:

Step 1: Fork the Repository

Fork the repository by clicking the Fork button at the top-right corner of this page. This will create a copy of the repository under your GitHub account.

Step 2: Clone the Fork

Once you’ve forked the repository, clone it to your local machine with:

git clone https://github.com/your-username/TypeScript.git

Basic File Structure

When learning TypeScript, it's important to understand the structure of a typical TypeScript setup. Here is a basic example.

Typescript/
│
├── 01Intro/
│   ├── intro.ts          # intro TypeScript file
│   ├── intro.js          # Transpield into Javascript
│   ├── variable.ts       # variable TypeScript file
│   └── variable.js       # Transpield into Javascript
│
├── 02Basic-Types/
│   ├── types.ts          # types TypeScript file
│   └── types.js          # Transpield into Javascript
│
├── 03Functions/
│   ├── functions.ts          # functions TypeScript file
│   └── functions.js          # Transpield into Javascript
│
└── tsconfig.json         # TypeScript configuration file

Explanation:

  • tsconfig.json: This is a configuration file that tells TypeScript how to compile your code.
  • package.json: This file is optional if you are learning TypeScript concepts and not using Node.js. It manages your project dependencies.

About

Learn or revise TypeScript

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published