MCPcopy
hub / github.com/torokmark/design_patterns_in_typescript

github.com/torokmark/design_patterns_in_typescript @main sqlite

repository ↗ · DeepWiki ↗
374 symbols 526 edges 47 files 0 documented · 0%
README

Design Patterns in TypeScript

Here are the implementations of the following design patterns in TypeScript:

Creational

Structural Patterns

Behavioral Patterns

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

Extension points exported contracts — how you extend this code

Component (Interface)
(no doc) [10 implementers]
decorator/decorator.ts
Component (Interface)
(no doc) [10 implementers]
composite/composite.ts
Strategy (Interface)
(no doc) [9 implementers]
strategy/strategy.ts
Flyweight (Interface)
(no doc) [10 implementers]
flyweight/flyweight.ts
Prototype (Interface)
(no doc) [6 implementers]
prototype/prototype.ts
Mediator (Interface)
(no doc) [5 implementers]
mediator/mediator.ts
Element (Interface)
(no doc) [5 implementers]
visitor/visitor.ts
Implementor (Interface)
(no doc) [4 implementers]
bridge/bridge.ts

Core symbols most depended-on inside this repo

show
called by 23
main.ts
request
called by 8
state/state.ts
operation
called by 5
composite/composite.ts
add
called by 5
composite/composite.ts
doAction
called by 5
proxy/proxy.ts
storeAndExecute
called by 4
command/command.ts
executeStrategy
called by 3
strategy/strategy.ts
register
called by 3
observer/observer.ts

Shape

Method 172
Class 156
Function 27
Interface 19

Languages

TypeScript100%

Modules by API surface

abstract_factory/abstractFactory.ts27 symbols
visitor/visitor.ts24 symbols
mediator/mediator.ts20 symbols
bridge/bridge.ts20 symbols
prototype/prototype.ts19 symbols
command/command.ts18 symbols
chain_of_responsibility/chainOfResponsibility.ts18 symbols
builder/builder.ts18 symbols
memento/memento.ts17 symbols
template_method/templateMethod.ts16 symbols
observer/observer.ts16 symbols
strategy/strategy.ts15 symbols

For agents

$ claude mcp add design_patterns_in_typescript \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact