https://github.com/chaudinh/design-patterns-with-typescript
Design patterns with TypeScript
https://github.com/chaudinh/design-patterns-with-typescript
Last synced: 4 months ago
JSON representation
Design patterns with TypeScript
- Host: GitHub
- URL: https://github.com/chaudinh/design-patterns-with-typescript
- Owner: ChauDinh
- Created: 2023-09-18T08:39:15.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-21T15:30:28.000Z (almost 2 years ago)
- Last Synced: 2025-01-19T14:19:10.983Z (5 months ago)
- Language: TypeScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Design Pattern with TypeScript
This repo is my practice when I learn design pattern concepts. It is written by TypeScript, a JavaScript superset so that will be familiar with most developers.
There are several design patterns and other OOP concepts covered:
- SOLID principles
- Software design patterns: Builder, Abstract Factory, Factory Method, Singleton, Strategy, Proxy, Prototype, etc#### Setup
This guide is my setup for a pattern directory
- Step 1: create and go to the pattern directory. For example, I create a directory named Factory Method and go into it:
```
mkdir factory_method && cd factory_method
```Note: the naming convention of folders is belong to your favorite.
- Step 2: init a Node.js project so that you can run the code in terminal
```
npm init -y
```Note: please notice the node.js version on your local. Currently I run version 18.
- Step 3: init typescript configuration
```
yarn add typescript ts-node -D
``````
npx tsc --init
```- Step 4: run a TypeScript file
```
npx ts-node your_file_name.ts
```