Skip to content

Commit

Permalink
Docs: Add "usage" section to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed May 14, 2018
1 parent 80358e3 commit a9e7eca
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,21 @@ sparkles
========

Namespaced global event emitter

## Usage

It just exports an `EventEmitter`. Think of it as a singleton.

```js
var sparkles = require('sparkles');

sparkles.on('my-event', function(evt){
console.log('my-event handled', evt);
});

sparkles.emit('my-event', { my: 'event' });
```

## License

MIT

0 comments on commit a9e7eca

Please sign in to comment.