This repository is a comprehensive collection of design patterns implemented in JavaScript. Design patterns are best practices that the developer community has found to be particularly useful in common scenarios. This project aims to illustrate how various design patterns can be applied in JavaScript development to solve specific design problems or enhance the efficiency of code.
To see the patterns in action, visit the demo sites:
-
Creation Patterns
- Singleton
- Factory
- Abstract Factory
- Constructor
- Prototype
- Module
- Revealing Module
-
Structure Patterns
- Facade
- Mixin
- Decorator
- Flyweight
-
Behavior Patterns
- Observer
- Mediator
- Command
To get started with the project, clone the repository and install the dependencies:
git clone https://github.com/nbursa/design-patterns.git
cd design-patterns
yarn install
This project uses Vite for a fast development server and efficient bundling. To start the development server, run:
yarn dev