Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
Update guide.md node.js instructions
Browse files Browse the repository at this point in the history
Update the instructions for requiring the EventEmitter in node.js
  • Loading branch information
peyerluk authored and Olical committed Apr 6, 2014
1 parent 6ef0133 commit 9c299ae
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions docs/guide.md
Expand Up @@ -58,12 +58,18 @@ require(['EventEmitter'], function(EventEmitter) {
});
```

### node.js
### node.js or Browser via Browserify

This is pretty simple, just require the file and load the `EventEmitter` attribute out of it.
This is pretty simple, just install the file via npm (or bower):

```bash
npm install wolfy87-eventemitter --save
```

...and then require it (if you used bower you have to require the relative path to the bower component)

```javascript
var EventEmitter = require('./assets/js/EventEmitter').EventEmitter;
var EventEmitter = require('wolfy87-eventemitter');
var ee = new EventEmitter();
```

Expand Down Expand Up @@ -292,4 +298,4 @@ ee.addListener(/ba[rz]/, function () {
console.log('Now you are thinking with regular expressions.');
});
ee.emitEvent(/ba[rz]/);
```
```

0 comments on commit 9c299ae

Please sign in to comment.