Skip to content

Commit d773298

Browse files
committed
Remove check for promise support
Signed-off-by: Matthew Peveler <[email protected]>
1 parent 64b49a5 commit d773298

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The `portfinder` module has a simple interface:
2020
});
2121
```
2222

23-
Or with promise (if `Promise`s are supported) :
23+
Or using promises:
2424

2525
``` js
2626
const portfinder = require('portfinder');
@@ -39,8 +39,6 @@ Or with promise (if `Promise`s are supported) :
3939
});
4040
```
4141

42-
If `portfinder.getPortPromise()` is called on a Node version without Promise (<4), it will throw an Error unless [Bluebird](http://bluebirdjs.com/docs/getting-started.html) or any Promise pollyfill is used.
43-
4442
### Ports search scope
4543

4644
By default `portfinder` will start searching from `8000` and scan until maximum port number (`65535`) is reached.

lib/portfinder.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,6 @@ exports.getPort = function (options, callback) {
226226
// Responds a promise to an unbound port on the current machine.
227227
//
228228
exports.getPortPromise = function (options) {
229-
if (typeof Promise !== 'function') {
230-
throw Error('Native promise support is not available in this version of node.' +
231-
'Please install a polyfill and assign Promise to global.Promise before calling this method');
232-
}
233229
if (!options) {
234230
options = {};
235231
}
@@ -280,10 +276,6 @@ exports.getPorts = function (count, options, callback) {
280276
// Responds with a promise that resolves to an array of unbound ports on the current machine.
281277
//
282278
exports.getPortsPromise = function (count, options) {
283-
if (typeof Promise !== 'function') {
284-
throw Error('Native promise support is not available in this version of node.' +
285-
'Please install a polyfill and assign Promise to global.Promise before calling this method');
286-
}
287279
if (!options) {
288280
options = {};
289281
}

0 commit comments

Comments
 (0)