https://github.com/torokmark/design_patterns_in_typescript
:triangular_ruler: Design pattern implementations in TypeScript
https://github.com/torokmark/design_patterns_in_typescript
adapter builder command composite design-patterns facade typescript
Last synced: about 1 month ago
JSON representation
:triangular_ruler: Design pattern implementations in TypeScript
- Host: GitHub
- URL: https://github.com/torokmark/design_patterns_in_typescript
- Owner: torokmark
- License: mit
- Created: 2013-07-07T21:49:06.000Z (over 13 years ago)
- Default Branch: main
- Last Pushed: 2023-09-05T02:44:07.000Z (about 3 years ago)
- Last Synced: 2026-08-03T06:40:32.899Z (4 months ago)
- Topics: adapter, builder, command, composite, design-patterns, facade, typescript
- Language: TypeScript
- Homepage: http://torokmark.github.io/design_patterns_in_typescript/
- Size: 78.1 KB
- Stars: 5,432
- Watchers: 171
- Forks: 766
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-design-patterns - design-patterns
- awesome-design-patterns - design-patterns
- awesome-design-patterns - design-patterns
- stars - torokmark/design_patterns_in_typescript - :triangular_ruler: Design pattern implementations in TypeScript (TypeScript)
- awesome-typescript - torokmark - design_patterns_in_typescript
- awesome-design-patterns - typescript
- github-ultimate-repos - torokmark/design_patterns_in_typescript - | ⭐ 5,426★ | 🍴 759 | 💻 `TypeScript`🔗 <https://github.com/torokmark/design_patterns_in_typescript>📝 :triangular_ruler: Design pattern implementations in TypeScript⚙️ `Declarative component IR -> Fiber lanes / fine-grained topological signals -> progressive streaming SSR hydration -> Rust Oxide AST utility CSS compilation -> DOM patch.` (📜 Master Categorized Repository Directory (100% Clickable Links) / [49] MODERN FRONTEND FRAMEWORKS, REACTIVE WEB ENGINES (REACT/VUE/SVELTE) & BUNDLERS)
- awesome-github-projects - design_patterns_in_typescript - :triangular_ruler: Design pattern implementations in TypeScript ⭐5,428 `TypeScript` (📦 Legacy & Inactive Projects)
- awesome-design-patterns - TypeScript设计模式 - 结合类型系统的模式优化(如用泛型实现工厂模式)。 (二、按编程语言分的核心设计模式 / **JavaScript/TypeScript**)
- awesome - torokmark/design_patterns_in_typescript - Design pattern implementations in TypeScript (5.4k stars) (General Programming)
README
# Design Patterns in TypeScript #
Here are the implementations of the following design patterns in TypeScript:
### Creational ###
* [Singleton](https://github.com/torokmark/design_patterns_in_typescript/tree/master/singleton)
* [Abstract Factory](https://github.com/torokmark/design_patterns_in_typescript/tree/master/abstract_factory)
* [Factory Method](https://github.com/torokmark/design_patterns_in_typescript/tree/master/factory_method)
* [Builder](https://github.com/torokmark/design_patterns_in_typescript/tree/master/builder)
* [Prototype](https://github.com/torokmark/design_patterns_in_typescript/tree/master/prototype)
### Structural Patterns ###
* [Adapter](https://github.com/torokmark/design_patterns_in_typescript/tree/master/adapter)
* [Bridge](https://github.com/torokmark/design_patterns_in_typescript/tree/master/bridge)
* [Composite](https://github.com/torokmark/design_patterns_in_typescript/tree/master/composite)
* [Decorator](https://github.com/torokmark/design_patterns_in_typescript/tree/master/decorator)
* [Facade](https://github.com/torokmark/design_patterns_in_typescript/tree/master/facade)
* [Flyweight](https://github.com/torokmark/design_patterns_in_typescript/tree/master/flyweight)
* [Proxy](https://github.com/torokmark/design_patterns_in_typescript/tree/master/proxy)
### Behavioral Patterns ###
* [Chain of Responsibility](https://github.com/torokmark/design_patterns_in_typescript/tree/master/chain_of_responsibility)
* [Command](https://github.com/torokmark/design_patterns_in_typescript/tree/master/command)
* [Interpreter](https://github.com/torokmark/design_patterns_in_typescript/tree/master/interpreter)
* [Iterator](https://github.com/torokmark/design_patterns_in_typescript/tree/master/iterator)
* [Mediator](https://github.com/torokmark/design_patterns_in_typescript/tree/master/mediator)
* [Memento](https://github.com/torokmark/design_patterns_in_typescript/tree/master/memento)
* [Observer](https://github.com/torokmark/design_patterns_in_typescript/tree/master/observer)
* [State](https://github.com/torokmark/design_patterns_in_typescript/tree/master/state)
* [Strategy](https://github.com/torokmark/design_patterns_in_typescript/tree/master/strategy)
* [Template Method](https://github.com/torokmark/design_patterns_in_typescript/tree/master/template_method)
* [Visitor](https://github.com/torokmark/design_patterns_in_typescript/tree/master/visitor)
## Compile the project
```
$ git clone https://github.com/torokmark/design_patterns_in_typescript.git
$ cd design_patterns_in_typescript
$ tsc
```
There is a `tsconfig.json` file in the root directory which is responsible for the compiler options.
As it is set the default target is Ecmascript5 now.
Any additional options come here.
By default the output is a `patterns.js` file.
To compile only one pattern, use the following command.
```
$ cd design_patterns_in_typescript/visitor
$ tsc --target ES5 --module system --outFile visitor.js visitor.ts
```
## Execute the project
After the compilation of the project, a `patterns.js` is generated by default.
Executing the file is:
```
node patterns.js
```