code: function IDOLclient(options) {
  
      // Validate default client options.
      if (options && _.isString(options)) {
          options = {
              APIkey: options
          };
      } else if (!_.isPlainObject(options)) {
          throw new Error('IDOLclient requires constructor options to be set as \'your APIkey\' or {}');
      } else if (!_.has(options, 'APIkey')) {
          throw new Error('IDOLclient needs `APIkey` property to be set');
      }
  
      // Handle default client options.
      this.options = _.defaults(options, {
          APIformat: {
              host: 'api.idolondemand.com',
              platform: '1'
          },
          autoResult: true,
          requestTimeout: false
      });
  
      // Add events functionality to the class.
      EventEmitter.call(this);
  }
docs: # API
  This is the `idol-client` API reference.
  
  ## Constructor
   
  Factory/Constructor creating class instances based on `options` parameter. This is what one gets when the lib is required in Node.js or embeded as script in the browser.
  
  In case `options` is a **String** then it should be the IDOL API key to use.
  If you need to alter the default options provide an **Object**. Posible `options` are:
  
  - **String** **Required** `APIkey`  IDOL's API key to use
  - **Object** `APIformat`  Used to build API URLs
  - `host`  Defaults to 'api.idolondemand.com'
  - `platform`  Defaults to '1'
  - **Boolean** `autoResult`  Automatically wait for async job result and fire result events. Defaults to `true`.
  - **Falsey|Int** `requestTimeout`  Reject request promises if not fulfilled or rejected after `requestTimeout`. Defaults to false.
  
  Examples:
  ```js
  var MyClient = require('idol-client')('MyRegisteredAPIkey');
  // or
  var MyClient = require('idol-client')({
  APIkey: 'MyRegisteredAPIkey'
  });
  // or in the browser
  var MyClient = IDOLclient('MyRegisteredAPIkey');
  ...
  ```
  @param {String|Object} options
  @api public