Skip to content

Commit 3827527

Browse files
rexxarssindresorhus
authored andcommitted
Use eventemitter3 module instead of Node.js EventEmitter (#58)
Fixes #55
1 parent cf653cb commit 3827527

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const EventEmitter = require('events');
3+
const EventEmitter = require('eventemitter3');
44

55
// Port of lower_bound from http://en.cppreference.com/w/cpp/algorithm/lower_bound
66
// Used to compute insertion index to keep queue sorted after insertion

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
"promises",
3838
"bluebird"
3939
],
40+
"dependencies": {
41+
"eventemitter3": "^3.1.0"
42+
},
4043
"devDependencies": {
4144
"@types/node": "^11.9.6",
4245
"ava": "^1.2.1",

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ getUnicornTask().then(task => queue.add(task)).then(() => {
4040

4141
### PQueue([options])
4242

43-
Returns a new `queue` instance, which is an [`EventEmitter`](https://nodejs.org/api/events.html) subclass.
43+
Returns a new `queue` instance, which is an [`EventEmitter3`](https://github.com/primus/eventemitter3) subclass.
4444

4545
#### options
4646

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import EventEmitter from 'events';
1+
import EventEmitter from 'eventemitter3';
22
import test from 'ava';
33
import delay from 'delay';
44
import inRange from 'in-range';

0 commit comments

Comments
 (0)