Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The `portfinder` module has a simple interface:
});
```

Or with promise (if `Promise`s are supported) :
Or using promises:

``` js
const portfinder = require('portfinder');
Expand All @@ -39,8 +39,6 @@ Or with promise (if `Promise`s are supported) :
});
```

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.

### Ports search scope

By default `portfinder` will start searching from `8000` and scan until maximum port number (`65535`) is reached.
Expand Down
8 changes: 0 additions & 8 deletions lib/portfinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,6 @@ exports.getPort = function (options, callback) {
// Responds a promise to an unbound port on the current machine.
//
exports.getPortPromise = function (options) {
if (typeof Promise !== 'function') {
throw Error('Native promise support is not available in this version of node.' +
'Please install a polyfill and assign Promise to global.Promise before calling this method');
}
if (!options) {
options = {};
}
Expand Down Expand Up @@ -280,10 +276,6 @@ exports.getPorts = function (count, options, callback) {
// Responds with a promise that resolves to an array of unbound ports on the current machine.
//
exports.getPortsPromise = function (count, options) {
if (typeof Promise !== 'function') {
throw Error('Native promise support is not available in this version of node.' +
'Please install a polyfill and assign Promise to global.Promise before calling this method');
}
if (!options) {
options = {};
}
Expand Down