https://github.com/pgarciacamou/go-patterns
JS Design Pattern Generator
https://github.com/pgarciacamou/go-patterns
design-patterns javascript javascript-library patterns
Last synced: 5 months ago
JSON representation
JS Design Pattern Generator
- Host: GitHub
- URL: https://github.com/pgarciacamou/go-patterns
- Owner: pgarciacamou
- License: mit
- Created: 2016-05-29T00:33:13.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-10-13T04:28:09.000Z (over 8 years ago)
- Last Synced: 2025-09-29T06:49:27.143Z (9 months ago)
- Topics: design-patterns, javascript, javascript-library, patterns
- Language: JavaScript
- Size: 182 KB
- Stars: 7
- Watchers: 3
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# go-patterns
JavaScript Design-Patterns Builder
### Installation
1. `npm install --save go-patterns`
2. `import patterns from 'go-patterns';`
### Usage
See [docs](https://github.com/pgarciacamou/go-patterns/wiki) for more patterns and information.
A simple example is the singleton, which the idea behind it is that you can only create a single instance from a class.
```js
import patterns from 'go-patterns';
let Singleton = patterns.singleton().build();
console.log(new Singleton() === new Singleton()) // true
```