Read in another language: Українська, English.
A small collection of cheat sheets and tips I've gathered during my studies and work on various projects. It includes all the main sections and subtopics of the TypeScript language.
- Clone the repository:
git clone https://github.com/labattaria/typescript-cheatsheets.git
- Install project dependencies:
cd typescript-cheatsheets
npm install
It will install all the necessary dependencies, including the reflect-metadata library, which is required for the decorators section (the last one).
We will need the following for the work:
- Install Node.js if it is not already installed. Preferably the LTS version, which is recommended for everyone. It rarely causes any issues.
- Install TypeScript globally by simply running:
npm install -g typescript
- Additionally, install the ts-node package by running:
npm install -g ts-node
To start the compiler (TS => JS), run the following command:
tsc ${path to the file .ts}
To create a configuration template, run the following command:
tsc --init
To quickly view the results of the code (quickly compile a specific file), run the following command:
ts-node ${path to the file .ts}
But mostly, it's just ready-made code and helpful tips for each section and subtopic of the TypeScript language. Each folder is a separate section of the language, and the files inside represent subtopics of that section. They contain ready-made snippet code solutions with brief descriptions. Each folder contains a subfolder called 'tasks' — these are comprehensive exercises that combine multiple subtopics and techniques from the corresponding section.