diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 70c85efb24..234fdad560 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -91,6 +91,7 @@ All definitions files include a header with the author and editors, so at some p
* [ES6-Promises](https://github.com/jakearchibald/ES6-Promises) (by [François de Campredon](https://github.com/fdecampredon/))
* [Esprima](http://esprima.org/) (by [Teppei Sato](https://github.com/teppeis))
* [expect.js](https://github.com/LearnBoost/expect.js) (by [Teppei Sato](https://github.com/teppeis))
+* [EventEmitter2](https://github.com/asyncly/EventEmitter2) (by [Ryo Iwamoto](https://github.com/ryiwamoto))
* [expectations](https://github.com/spmason/expectations) (by [vvakame](https://github.com/vvakame))
* [Express](http://expressjs.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [express-session](https://www.npmjs.org/package/express-session) (by [Hiroki Horiuchi](https://github.com/horiuchi/))
diff --git a/eventemitter2/eventemitter2-tests.ts b/eventemitter2/eventemitter2-tests.ts
new file mode 100644
index 0000000000..831561b876
--- /dev/null
+++ b/eventemitter2/eventemitter2-tests.ts
@@ -0,0 +1,92 @@
+///
+
+// import eventemitter2 = require("eventemitter2");
+// var EventEmitter2 = eventemitter2.EventEmitter2;
+
+function testConfiguration() {
+ var foo = new EventEmitter2({
+ wildcard: true,
+ delimiter: '::',
+ newListener: false,
+ maxListeners: 20
+ });
+ var bar = new EventEmitter2({});
+ var bazz = new EventEmitter2();
+}
+
+var server = new EventEmitter2();
+
+function testAddListener() {
+ server.addListener('data', function (value1: any, value2: any, value3: any) {
+ console.log('The event was raised!');
+ });
+
+ server.addListener('data', function (value: any) {
+ console.log('The event was raised!');
+ });
+}
+
+function testOn() {
+ server.on('data', function (value1: any, value2: any, value3: any) {
+ console.log('The event was raised!');
+ });
+
+ server.on('data', function (value: any) {
+ console.log('The event was raised!');
+ });
+}
+
+function testOnAny() {
+ server.onAny(function (value: any) {
+ console.log('All events trigger this.');
+ });
+}
+
+function testOffAny() {
+ server.offAny(function (value: any) {
+ console.log('The event was raised!');
+ });
+}
+
+function testOnce() {
+ server.once('get', function (value: any) {
+ console.log('Ah, we have our first value!');
+ });
+}
+
+function testMany() {
+ server.many('get', 4, function (value: any) {
+ console.log('This event will be listened to exactly four times.');
+ });
+}
+
+function testRemoveListener() {
+ var callback = function (value: any) {
+ console.log('someone connected!');
+ };
+ server.on('get', callback);
+ server.removeListener('get', callback);
+}
+
+function testRemoveAllListeners() {
+ server.removeAllListeners(["test::event", "another::test::event"]);
+ server.removeAllListeners("test");
+ server.removeAllListeners();
+}
+
+function testSetMaxListeners() {
+ server.setMaxListeners(40);
+}
+
+function testListeners() {
+ console.log(server.listeners('get'));
+}
+
+function testListenersAny() {
+ console.log(server.listenersAny()[0]);
+}
+
+function testEmit() {
+ server.emit('foo.bazz');
+ server.emit(['foo', 'bar']);
+}
diff --git a/eventemitter2/eventemitter2.d.ts b/eventemitter2/eventemitter2.d.ts
new file mode 100644
index 0000000000..a02124c374
--- /dev/null
+++ b/eventemitter2/eventemitter2.d.ts
@@ -0,0 +1,146 @@
+// Type definitions for EventEmitter2 v0.14.4
+// Project: https://github.com/asyncly/EventEmitter2
+// Definitions by: ryiwamoto
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+declare module eventemitter2 {
+ interface Configuration {
+ /**
+ * use wildcards
+ */
+ wildcard?: boolean;
+
+ /**
+ * the delimiter used to segment namespaces, defaults to `.`.
+ */
+ delimiter?: string;
+
+ /**
+ * if you want to emit the newListener event set to true.
+ */
+ newListener?: boolean;
+
+ /**
+ * max listeners that can be assigned to an event, default 10.
+ */
+ maxListeners?: number;
+ }
+
+ export class EventEmitter2 {
+ /**
+ * @param conf
+ */
+ constructor(conf?: Configuration);
+
+ /**
+ * Adds a listener to the end of the listeners array for the specified event.
+ * @param event
+ * @param listener
+ */
+ addListener(event: string, listener: Function): EventEmitter2;
+
+ /**
+ * Adds a listener to the end of the listeners array for the specified event.
+ * @param event
+ * @param listener
+ */
+ on(event: string, listener: Function): EventEmitter2;
+
+ /**
+ * Adds a listener that will be fired when any event is emitted.
+ * @param listener
+ */
+ onAny(listener: Function): EventEmitter2;
+
+ /**
+ * Removes the listener that will be fired when any event is emitted.
+ * @param listener
+ */
+ offAny(listener: Function): EventEmitter2;
+
+ /**
+ * Adds a one time listener for the event.
+ * The listener is invoked only the first time the event is fired, after which it is removed.
+ * @param event
+ * @param listener
+ */
+ once(event: string, listener: Function): EventEmitter2;
+
+ /**
+ * Adds a listener that will execute n times for the event before being removed.
+ * The listener is invoked only the first n times the event is fired, after which it is removed.
+ * @param event
+ * @param timesToListen
+ * @param listener
+ */
+ many(event: string, timesToListen: number, listener: Function): EventEmitter2;
+
+ /**
+ * Remove a listener from the listener array for the specified event.
+ * Caution: changes array indices in the listener array behind the listener.
+ * @param event
+ * @param listener
+ */
+ removeListener(event: string, listener: Function): EventEmitter2;
+
+ /**
+ * Remove a listener from the listener array for the specified event.
+ * Caution: changes array indices in the listener array behind the listener.
+ * @param event
+ * @param listener
+ */
+ off(event: string, listener: Function): EventEmitter2;
+
+ /**
+ * Removes all listeners, or those of the specified event.
+ * @param event
+ */
+ removeAllListeners(event?: string): EventEmitter2;
+
+ /**
+ * Removes all listeners, or those of the specified event.
+ * @param events
+ */
+ removeAllListeners(events: string[]): EventEmitter2;
+
+ /**
+ * By default EventEmitters will print a warning if more than 10 listeners are added to it.
+ * This is a useful default which helps finding memory leaks.
+ * Obviously not all Emitters should be limited to 10. This function allows that to be increased.
+ * Set to zero for unlimited.
+ * @param n
+ */
+ setMaxListeners(n: number): void;
+
+ /**
+ * Returns an array of listeners for the specified event. This array can be manipulated, e.g. to remove listeners.
+ * @param event
+ */
+ listeners(event: string): Function[];
+
+ /**
+ * Returns an array of listeners that are listening for any event that is specified.
+ * This array can be manipulated, e.g. to remove listeners.
+ */
+ listenersAny(): Function[];
+
+ /**
+ * Execute each of the listeners that may be listening for the specified event name in order with the list of arguments.
+ * @param event
+ * @param args
+ */
+ emit(event: string, ...args: string[]): boolean;
+
+ /**
+ * Execute each of the listeners that may be listening for the specified event name in order with the list of arguments.
+ * @param event
+ */
+ emit(event: string[]): boolean;
+ }
+}
+
+declare module "eventemitter2" {
+ export = eventemitter2;
+}
+
+declare var EventEmitter2: typeof eventemitter2.EventEmitter2;