diff --git a/README.md b/README.md index a6a9d8d..2ce8adf 100644 --- a/README.md +++ b/README.md @@ -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'); @@ -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. diff --git a/lib/portfinder.js b/lib/portfinder.js index 56cb5bd..ef4f206 100644 --- a/lib/portfinder.js +++ b/lib/portfinder.js @@ -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 = {}; } @@ -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 = {}; }