# Javascript design patterns for both browser and Node.js

Javascript design patterns for both browser and Node.js. I am a customer of text book "Learning JavaScript Design Patterns". I learn javascript design patterns using original source code at [https://github.com/addyosmani/essential-js-design-patterns](Learning JavaScript Design Patterns). This project could be an additional support to target audience of the text book and students who wishing to learn javascript design patterns with my code examples and some of my extended code based on this text book. 

[![NPM](https://nodei.co/npm/design-pattern.png)](https://nodei.co/npm/design-pattern/)]

# Install
```
npm install design-pattern

or 

git clone https://github.com/vorachet/design-pattern.git
```

# Usage

## Creational
* [Prototype](#prototype)

## Structural
* [Facade](#facade)
* [Flyweight](#flyweight)

## Behavioral
* [Observer](#observer)

## <a name="observer"></a>Observer pattern

* [Implementation example](src/observer.js)
* [Browser usage example](example/observer.html)
* [Node.js usage example](example/observer.js)
* [Output](example/observer.txt)

## <a name="facade"></a>Facade pattern

* [Implementation example](src/facade.js)
* [Browser usage example](example/facade.html)
* [Node.js usage example](example/facade.js)
* [Output](example/facade.txt)

## <a name="prototype"></a>Prototype pattern

* [Implementation example](src/prototype.js)
* [Browser usage example](example/prototype.html)
* [Node.js usage example](example/prototype.js)
* [Output](example/prototype.txt)

## <a name="flyweight"></a>Flyweight pattern

* [Implementation example](src/flyweight.js)
* [Browser usage example](example/flyweight.html)
* [Node.js usage example](example/flyweight.js)
* [Output](example/flyweight.txt)

# License

This project is released under a Creative Commons Attribution-Noncommercial- No Derivative Works 3.0 License.

What this means it that the project is free to read and use, but the license does not permit commercial use of the material.

Copyright Vorachet Jaronesawas, 2015.
