lib/client.js
function Client (opts) {
  // update client instance and config
  // with overrides from opts.
  _.extend(this, {
    Saver: require('./saver').Saver
  }, opts)

  config.extend(opts)

  // allow sqs to be overridden
  // in tests.
  if (opts && opts.sqs) {
    this.sqs = opts.sqs
    delete opts.sqs
  } else {
    this.sqs = new aws.SQS({
      accessKeyId: config.get('awsKey'),
      secretAccessKey: config.get('awsSecret'),
      region: config.get('awsRegion')
    })
  }

  config.set('sqsQueueUrl', this.sqs.endpoint.protocol + '//' + this.sqs.endpoint.hostname + '/' + config.get('sqsQueue'))
}
function Client (opts) {
  // update client instance and config
  // with overrides from opts.
  _.extend(this, {
    Saver: require('./saver').Saver
  }, opts)

  config.extend(opts)

  // allow sqs to be overridden
  // in tests.
  if (opts && opts.sqs) {
    this.sqs = opts.sqs
    delete opts.sqs
  } else {
    this.sqs = new aws.SQS({
      accessKeyId: config.get('awsKey'),
      secretAccessKey: config.get('awsSecret'),
      region: config.get('awsRegion')
    })
  }

  config.set('sqsQueueUrl', this.sqs.endpoint.protocol + '//' + this.sqs.endpoint.hostname + '/' + config.get('sqsQueue'))
}
function Client ( opts ) { // update client instance and config // with overrides from opts. _ . extend ( this , { Saver : require ( './saver' ) . Saver } , opts ) config . extend ( opts ) // allow sqs to be overridden // in tests. if ( opts && opts . sqs ) { this . sqs = opts . sqs delete opts . sqs } else { this . sqs = new aws . SQS ( { accessKeyId : config . get ( 'awsKey' ) , secretAccessKey : config . get ( 'awsSecret' ) , region : config . get ( 'awsRegion' ) } ) } config . set ( 'sqsQueueUrl' , this . sqs . endpoint . protocol + '//' + this . sqs . endpoint . hostname + '/' + config . get ( 'sqsQueue' ) ) }
Initialize the Client

@param object opts The Client options
Initialize the Client